Merge "Fix other reproduction of invisible keyguard race" into tm-qpr-dev am: 2b9ee44d55

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21300119

Change-Id: I3ef7ac143f2ab66dba689465e41ac09c12658808
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hawkwood Glazier
2023-02-28 13:49:01 +00:00
committed by Automerger Merge Worker
2 changed files with 14 additions and 0 deletions

View File

@@ -3748,6 +3748,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

@@ -1024,6 +1024,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<>());