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

Commit e45a505e authored by Matt Pietal's avatar Matt Pietal
Browse files

Test when WM needs to be reshown...

... after a keyguard exit animation starts but power manager then says
the device is not interactive. This should show keyguard and tell WM.

Fixes: 301751150
Test: atest KeyguardViewMediatorTest
Flag: N/A
Change-Id: I30b53af60eed2cd2eb000c0413cf38bab3f41461
parent 418eb70e
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -2720,9 +2720,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

    private void updateActivityLockScreenState(boolean showing, boolean aodShowing) {
        mUiBgExecutor.execute(() -> {
            if (DEBUG) {
            Log.d(TAG, "updateActivityLockScreenState(" + showing + ", " + aodShowing + ")");
            }

            if (mFeatureFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
                // Handled in WmLockscreenVisibilityManager if flag is enabled.
+14 −0
Original line number Diff line number Diff line
@@ -910,6 +910,20 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
        assertATMSAndKeyguardViewMediatorStatesMatch();
    }

    @Test
    @TestableLooper.RunWithLooper(setAsMainLooper = true)
    public void testStartKeyguardExitAnimation_whenNotInteractive_doesShowAndUpdatesWM() {
        // If the exit animation was triggered but the device became non-interactive, make sure
        // relock happens
        when(mPowerManager.isInteractive()).thenReturn(false);

        startMockKeyguardExitAnimation();
        cancelMockKeyguardExitAnimation();

        verify(mStatusBarKeyguardViewManager, atLeast(1)).show(null);
        assertATMSAndKeyguardViewMediatorStatesMatch();
    }

    /**
     * Interactions with the ActivityTaskManagerService and others are posted to an executor that
     * doesn't use the testable looper. Use this method to ensure those are run as well.