Merge "Make the notif panel focusable during screen off so touch events don't go to the app behind." into sc-dev
This commit is contained in:
@@ -99,6 +99,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
|
||||
mCallbacks = Lists.newArrayList();
|
||||
|
||||
private final SysuiColorExtractor mColorExtractor;
|
||||
private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
|
||||
private float mFaceAuthDisplayBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
|
||||
|
||||
@Inject
|
||||
@@ -110,7 +111,8 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
|
||||
KeyguardBypassController keyguardBypassController,
|
||||
SysuiColorExtractor colorExtractor,
|
||||
DumpManager dumpManager,
|
||||
KeyguardStateController keyguardStateController) {
|
||||
KeyguardStateController keyguardStateController,
|
||||
UnlockedScreenOffAnimationController unlockedScreenOffAnimationController) {
|
||||
mContext = context;
|
||||
mWindowManager = windowManager;
|
||||
mActivityManager = activityManager;
|
||||
@@ -121,6 +123,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
|
||||
mKeyguardViewMediator = keyguardViewMediator;
|
||||
mKeyguardBypassController = keyguardBypassController;
|
||||
mColorExtractor = colorExtractor;
|
||||
mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController;
|
||||
dumpManager.registerDumpable(getClass().getName(), this);
|
||||
|
||||
mLockScreenDisplayTimeout = context.getResources()
|
||||
@@ -300,7 +303,11 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
|
||||
private void applyFocusableFlag(State state) {
|
||||
boolean panelFocusable = state.mNotificationShadeFocusable && state.mPanelExpanded;
|
||||
if (state.mBouncerShowing && (state.mKeyguardOccluded || state.mKeyguardNeedsInput)
|
||||
|| ENABLE_REMOTE_INPUT && state.mRemoteInputActive) {
|
||||
|| ENABLE_REMOTE_INPUT && state.mRemoteInputActive
|
||||
// Make the panel focusable if we're doing the screen off animation, since the light
|
||||
// reveal scrim is drawing in the panel and should consume touch events so that they
|
||||
// don't go to the app behind.
|
||||
|| mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()) {
|
||||
mLpChanged.flags &= ~LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
mLpChanged.flags &= ~LayoutParams.FLAG_ALT_FOCUSABLE_IM;
|
||||
} else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) {
|
||||
|
||||
@@ -72,6 +72,7 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
|
||||
@Mock ColorExtractor.GradientColors mGradientColors;
|
||||
@Mock private DumpManager mDumpManager;
|
||||
@Mock private KeyguardStateController mKeyguardStateController;
|
||||
@Mock private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
|
||||
@Captor private ArgumentCaptor<WindowManager.LayoutParams> mLayoutParameters;
|
||||
|
||||
private NotificationShadeWindowControllerImpl mNotificationShadeWindowController;
|
||||
@@ -85,7 +86,8 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
|
||||
mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext,
|
||||
mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
|
||||
mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController,
|
||||
mColorExtractor, mDumpManager, mKeyguardStateController);
|
||||
mColorExtractor, mDumpManager, mKeyguardStateController,
|
||||
mUnlockedScreenOffAnimationController);
|
||||
mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView);
|
||||
|
||||
mNotificationShadeWindowController.attach();
|
||||
|
||||
@@ -98,6 +98,7 @@ import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||
import com.android.systemui.statusbar.phone.NotificationShadeWindowControllerImpl;
|
||||
import com.android.systemui.statusbar.phone.NotificationShadeWindowView;
|
||||
import com.android.systemui.statusbar.phone.ShadeController;
|
||||
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
|
||||
import com.android.systemui.statusbar.policy.BatteryController;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||
import com.android.systemui.statusbar.policy.HeadsUpManager;
|
||||
@@ -233,6 +234,8 @@ public class BubblesTest extends SysuiTestCase {
|
||||
private ShellTaskOrganizer mShellTaskOrganizer;
|
||||
@Mock
|
||||
private KeyguardStateController mKeyguardStateController;
|
||||
@Mock
|
||||
private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
|
||||
|
||||
private TestableBubblePositioner mPositioner;
|
||||
|
||||
@@ -255,7 +258,8 @@ public class BubblesTest extends SysuiTestCase {
|
||||
mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext,
|
||||
mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
|
||||
mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController,
|
||||
mColorExtractor, mDumpManager, mKeyguardStateController);
|
||||
mColorExtractor, mDumpManager, mKeyguardStateController,
|
||||
mUnlockedScreenOffAnimationController);
|
||||
mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView);
|
||||
mNotificationShadeWindowController.attach();
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||
import com.android.systemui.statusbar.phone.NotificationShadeWindowControllerImpl;
|
||||
import com.android.systemui.statusbar.phone.NotificationShadeWindowView;
|
||||
import com.android.systemui.statusbar.phone.ShadeController;
|
||||
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController;
|
||||
import com.android.systemui.statusbar.policy.BatteryController;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||
import com.android.systemui.statusbar.policy.HeadsUpManager;
|
||||
@@ -197,6 +198,8 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase {
|
||||
private ShellTaskOrganizer mShellTaskOrganizer;
|
||||
@Mock
|
||||
private KeyguardStateController mKeyguardStateController;
|
||||
@Mock
|
||||
private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
|
||||
|
||||
private TestableBubblePositioner mPositioner;
|
||||
|
||||
@@ -218,7 +221,8 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase {
|
||||
mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext,
|
||||
mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
|
||||
mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController,
|
||||
mColorExtractor, mDumpManager, mKeyguardStateController);
|
||||
mColorExtractor, mDumpManager, mKeyguardStateController,
|
||||
mUnlockedScreenOffAnimationController);
|
||||
mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView);
|
||||
mNotificationShadeWindowController.attach();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user