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

Commit d6c0498d authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Test when WM needs to be reshown..." into main

parents fa48db8c e45a505e
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.