Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3df40e98 authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

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
parent 2f927cff
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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()
+12 −0
Original line number Diff line number Diff line
@@ -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<>());