Fix other reproduction of invisible keyguard race

Similar to Id20a300edfa52433642747dbcdb1ecceeffadba8, the keyguard
becomes invisible after the keyguard erronously enters a bad state
due to racing unlock and lock requests from the user. This corrects
it for this reproduction by cancelling the inprogress unlock
animation.

Bug: 267711359
Test: Manually tested on device
Change-Id: I6985a667827ac068af8e2eb5756edc30f7545cd9
This commit is contained in:
Hawkwood Glazier
2023-02-06 20:05:31 +00:00
parent 2c26442bbd
commit 8f26dfb58e
2 changed files with 14 additions and 0 deletions

View File

@@ -3753,6 +3753,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
} else {
mScrimController.transitionTo(ScrimState.AUTH_SCRIMMED);
}
// 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 (mBouncerShowing && !unlocking) {
// Bouncer needs the front scrim when it's on top of an activity,
// tapping on a notification, editing QS or being dismissed by

View File

@@ -1021,6 +1021,17 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
verify(mStatusBarKeyguardViewManager).onKeyguardFadedAway();
}
@Test
public void testSetDozingNotUnlocking_transitionToAuthScrimmed_cancelKeyguardFadingAway() {
when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);
when(mKeyguardStateController.isKeyguardFadingAway()).thenReturn(true);
mCentralSurfaces.updateScrimController();
verify(mScrimController).transitionTo(eq(ScrimState.AUTH_SCRIMMED_SHADE));
verify(mStatusBarKeyguardViewManager).onKeyguardFadedAway();
}
@Test
public void testShowKeyguardImplementation_setsState() {
when(mLockscreenUserManager.getCurrentProfiles()).thenReturn(new SparseArray<>());