From fac6505c97b2cc1f8fb02b3fba04131d240e181f Mon Sep 17 00:00:00 2001 From: Josh Tsuji Date: Tue, 2 Aug 2022 21:15:03 -0400 Subject: [PATCH] Don't reset the keyguard on occlusion if it's going away. The reset() call only executes if the keyguard is visible, and causes it to reset the visible views (it can not show/hide the keyguard). However, if the keyguard is going away because of a launching occluding activity, and was previously insecure, this will cause us to decide that the views should be in SHADE state rather than KEYGUARD state, and re-render them accordingly. This causes the shade to flicker under the launching activity. This reset is not needed, as the status bar state change will change to SHADE after the launch animation occurs (or will be forced back to KEYGUARD if the unlock animation is cancelled). Fixes: 238294986 Test: launch controls from LS affordance with/without face unlock, with/without AOD Change-Id: Ib0622655ef6f51e1bcc9a98a5ce8f4e7feacb2fe --- .../statusbar/phone/StatusBarKeyguardViewManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 63c5e61ac4e53..b3d0a50f02d0f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -735,8 +735,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } mNotificationShadeWindowController.setKeyguardOccluded(mOccluded); - // setDozing(false) will call reset once we stop dozing. - if (!mDozing) { + // setDozing(false) will call reset once we stop dozing. Also, if we're going away, there's + // no need to reset the keyguard views as we'll be gone shortly. Resetting now could cause + // unexpected visible behavior if the keyguard is still visible as we're animating unlocked. + if (!mDozing && !mKeyguardStateController.isKeyguardGoingAway()) { // If Keyguard is reshown, don't hide the bouncer as it might just have been requested // by a FLAG_DISMISS_KEYGUARD_ACTIVITY. reset(isOccluding /* hideBouncerWhenShowing*/);