diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java index c958796500496..98fb6f32f0bc6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java @@ -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) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImplTest.java index 9fe47eceff1b9..b03712c2d997b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImplTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImplTest.java @@ -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 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(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java index 9fa35f8bd9f62..eb9206daec135 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java @@ -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(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java index 55cc8bb1780d6..24a5b3a42bb43 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java @@ -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();