diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 91cf7108c7281..eef41e0459485 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -2395,6 +2395,9 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, return; } mDozing = dozing; + if (!dozing) { + mAnimatingScreenOff = false; + } setShowingLocked(mShowing); } @@ -2404,7 +2407,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, // is 1f), then show the activity lock screen. if (mAnimatingScreenOff && mDozing && linear == 1f) { mAnimatingScreenOff = false; - setShowingLocked(mShowing); + setShowingLocked(mShowing, true); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt index e391250dc8fd6..50cbbd5d48526 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt @@ -264,6 +264,20 @@ class NotificationWakeUpCoordinator @Inject constructor( } override fun onStateChanged(newState: Int) { + if (dozeParameters.shouldControlUnlockedScreenOff()) { + if (animatingScreenOff && + state == StatusBarState.KEYGUARD && + newState == StatusBarState.SHADE) { + // If we're animating the screen off and going from KEYGUARD back to SHADE, the + // animation was cancelled and we are unlocking. Override the doze amount to 0f (not + // dozing) so that the notifications are no longer hidden. + setDozeAmount(0f, 0f) + } + + animatingScreenOff = + state == StatusBarState.SHADE && newState == StatusBarState.KEYGUARD + } + overrideDozeAmountIfBypass() if (bypassController.bypassEnabled && newState == StatusBarState.KEYGUARD && state == StatusBarState.SHADE_LOCKED && @@ -273,13 +287,6 @@ class NotificationWakeUpCoordinator @Inject constructor( setNotificationsVisible(visible = false, increaseSpeed = false, animate = true) } - // If we want to control the screen off animation, check whether we are going from SHADE to - // KEYGUARD. - if (dozeParameters.shouldControlUnlockedScreenOff()) { - animatingScreenOff = - state == StatusBarState.SHADE && newState == StatusBarState.KEYGUARD - } - this.state = newState } @@ -386,8 +393,6 @@ class NotificationWakeUpCoordinator @Inject constructor( override fun onDozingChanged(isDozing: Boolean) { if (isDozing) { setNotificationsVisible(visible = false, animate = false, increaseSpeed = false) - } else { - animatingScreenOff = false } }