diff options
| author | 2021-02-17 20:56:25 -0500 | |
|---|---|---|
| committer | 2021-02-17 21:00:52 -0500 | |
| commit | f701d3ef0d56dcdd0b740dc5eae6e9fa3c274b96 (patch) | |
| tree | 89b4b866d6edeed2b2bcdbd0ec9ca85f786b6c90 | |
| parent | d000396e2e9a260e7c78a896af10fc9245283886 (diff) | |
Fix issues with interrupted screen off animations.
Two problems here:
- The activity lock screen was not being shown after the doze animation finished because forceCallbacks was false. We short-circuited if showing == showing and aodShowing == aodShowing, and both of those are true after the screen off animation.
- Notifications would be gone until the next lock/unlock, sometimes longer. This is because we were overridding the doze amount in the NotificationWakeUpCoordinator, so that the notifications are not visible as the shade animates in during the screen off animation. If interrupted, the doze amount in the wake up coordinator remained overridden at 1f, which meant we were hiding them thinking we were on AOD.
Fixes: 180100349
Test: Press the power button to trigger screen off, quickly auth via fingerprint before the animation finishes. notice that the notification shade has notifications wow!
Change-Id: Iad608121adcc53c7d471607c438ba4542ea58143
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 5 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt | 23 |
2 files changed, 18 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 91cf7108c728..eef41e045948 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 e391250dc8fd..50cbbd5d4852 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 } } |