From ef8d78874f344ca344ed4caa369f5a042e7fcc2c Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Tue, 14 Jun 2022 19:00:42 +0000 Subject: [PATCH] Fix notifications disappearing when shade fully expands. The notifications would disappear with the shade fully expands because the shade calculation uses the expanded state if it's not 0 or 1, so when expansion becomes 1 the 'fraction' falls back to using the doze amount, which is 1, causing notifications to disappear. This was only happening because of a bug where the dozeAmount was left as 1.0 while the device was unlocked during the screen off animation. The core fix here is to clear the dozeAmount when cancelling screen off. Fixes: 234979264 Test: enable aod & rear/side fingerprint auth; go to launcher; tap power to turn screen off; unlock with finger during the animation; pull shade to see notifications Change-Id: If781da0cf941d3560be8bd6b27429e1d94448576 --- .../notification/NotificationWakeUpCoordinator.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 a8d685229b32d..126a986ee5f40 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt @@ -265,12 +265,12 @@ class NotificationWakeUpCoordinator @Inject constructor( } override fun onStateChanged(newState: Int) { - if (screenOffAnimationController.overrideNotificationsFullyDozingOnKeyguard() && - 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. + if (state == StatusBarState.SHADE && newState == StatusBarState.SHADE) { + // The SHADE -> SHADE transition is only possible as part of cancelling the screen-off + // animation (e.g. by fingerprint unlock). This is done because the system is in an + // undefined state, so it's an indication that we should do state cleanup. We override + // the doze amount to 0f (not dozing) so that the notifications are no longer hidden. + // See: UnlockedScreenOffAnimationController.onFinishedWakingUp() setDozeAmount(0f, 0f) }