diff options
| author | 2023-01-12 21:11:48 +0000 | |
|---|---|---|
| committer | 2023-01-26 18:30:53 +0000 | |
| commit | 3df40e98cb524e39e58103af0ee307aa48ac4d98 (patch) | |
| tree | 219bc680435baa260fcb208d5bbe701bbf7cf5a7 | |
| parent | 2f927cffc88c695e60f8764b896e66c6ee79d24d (diff) | |
Fix missing KeyguardStatusView after cancelling fps login
FPS login will trigger keyguard fading away. If that is cancelled by
pressing the side button, then the keyguard will instead transition
to AOD. Depending on the timing of the transition, this can leave
keyguard fading away as set, causing any subsequent animation that
doesn't reset it correctly to hide the KeyguardStatusView.
Fixes: 262112441
Test: Manually verified that race doesn't leave keyguard in bad state
Change-Id: Id20a300edfa52433642747dbcdb1ecceeffadba8
2 files changed, 15 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index f6a06ea67b4b..5ff755e10a6c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -3772,6 +3772,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { }); } else if (mDozing && !unlocking) { mScrimController.transitionTo(ScrimState.AOD); + // This will cancel the keyguardFadingAway animation if it is running. We need to do + // this as otherwise it can remain pending and leave keyguard in a weird state. + mUnlockScrimCallback.onCancelled(); } else if (mKeyguardStateController.isShowing() && !isOccluded() && !unlocking) { mScrimController.transitionTo(ScrimState.KEYGUARD); } else if (mKeyguardStateController.isShowing() && mKeyguardUpdateMonitor.isDreaming() diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java index b1363a047307..06053987202c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java @@ -1010,6 +1010,18 @@ public class CentralSurfacesImplTest extends SysuiTestCase { } @Test + public void testSetDozingNotUnlocking_transitionToAOD_cancelKeyguardFadingAway() { + setDozing(true); + when(mKeyguardStateController.isShowing()).thenReturn(false); + when(mKeyguardStateController.isKeyguardFadingAway()).thenReturn(true); + + mCentralSurfaces.updateScrimController(); + + verify(mScrimController, times(2)).transitionTo(eq(ScrimState.AOD)); + verify(mStatusBarKeyguardViewManager).onKeyguardFadedAway(); + } + + @Test public void testShowKeyguardImplementation_setsState() { when(mLockscreenUserManager.getCurrentProfiles()).thenReturn(new SparseArray<>()); |