Merge "Fix missing KeyguardStatusView after cancelling fps login" into tm-qpr-dev

This commit is contained in:
Hawkwood Glazier
2023-01-27 16:26:00 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 0 deletions

View File

@@ -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()

View File

@@ -1009,6 +1009,18 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
verify(mScrimController).transitionTo(eq(ScrimState.KEYGUARD));
}
@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<>());