From baf80f6afaac9004c93267933adf911f781ab993 Mon Sep 17 00:00:00 2001 From: Beverly Date: Fri, 29 Apr 2022 20:08:33 +0000 Subject: [PATCH] Don't show the bouncer onPanelExpansionChanged when dozing + not pulsing When the device goes to sleep from the power button, the call to show the keyguard on AOD updates the NotificationPanel expansion to show to see the AOD views. However, with certain timing (keyguardShowing=true 'too early'), the panel expansion change ends up showing the bouncer since the panel expansion controls the bouncer when keyguardShowing=true. Showing the bouncer subsequently wakes up the device, resulting in the device waking up right after the user pressed the power button with the intention to enter AoD. This CL prevents onPanelExpansionChanged from effecting the bouncer expansion when the device is dozing (and not pulsing). Test: press power button from home screen & when qs is expanded, notice that device consistently goes to sleep and doesn't immediately wake back up Test: fail udfps twice on AoD, see bouncer still apears Test: receive a notification in AoD w/ an intent, tap on notification and see bouncer (UDFPS or primary auth) appears Fixes: 228788448 Change-Id: Ifb8888900a3bd2f229f4bfdda9a59f0778efc5dd --- .../statusbar/phone/StatusBarKeyguardViewManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index 052a4f7c5f7cf..2801ba30836c9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -364,12 +364,15 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb || mNotificationPanelViewController.isExpanding()); // We don't want to translate the bounce when: + // • device is dozing and not pulsing // • Keyguard is occluded, because we're in a FLAG_SHOW_WHEN_LOCKED activity and need to // conserve the original animation. // • The user quickly taps on the display and we show "swipe up to unlock." // • Keyguard will be dismissed by an action. a.k.a: FLAG_DISMISS_KEYGUARD_ACTIVITY // • Full-screen user switcher is displayed. - if (mNotificationPanelViewController.isUnlockHintRunning()) { + if (mDozing && !mPulsing) { + return; + } else if (mNotificationPanelViewController.isUnlockHintRunning()) { mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN); } else if (mStatusBarStateController.getState() == StatusBarState.SHADE_LOCKED && mKeyguardUpdateManager.isUdfpsEnrolled()) {