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

Commit 1b5ab2f4 authored by Yunfan Chen's avatar Yunfan Chen Committed by Android (Google) Code Review
Browse files

Merge "Fixing new shell keyguard inconsistency" into main

parents f30387e6 029b92b8
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -310,12 +310,19 @@ class KeyguardController {
        try {
            state.writeEventLog("keyguardGoingAway");
            final int transitFlags = convertTransitFlags(flags);
            if (ENABLE_NEW_KEYGUARD_SHELL_TRANSITIONS) {
                final Transition transition = chain.getTransition();
                if (transition != null && displayId == DEFAULT_DISPLAY) {
                    transition.addFlag(TRANSIT_FLAG_KEYGUARD_GOING_AWAY);
                }
            } else {
                final DisplayContent dc = mRootWindowContainer.getDefaultDisplay();
                // We are deprecating TRANSIT_KEYGUARD_GOING_AWAY for Shell transition and use
            // TRANSIT_FLAG_KEYGUARD_GOING_AWAY to indicate that it should animate keyguard going
            // away.
                // TRANSIT_FLAG_KEYGUARD_GOING_AWAY to indicate that it should animate keyguard
                // going away.
                dc.mAtmService.getTransitionController().requestTransitionIfNeeded(
                        TRANSIT_TO_BACK, transitFlags, null /* trigger */, dc, chain);
            }
            updateKeyguardSleepToken();

            // Some stack visibility might change (e.g. docked stack)
+20 −7
Original line number Diff line number Diff line
@@ -2543,10 +2543,15 @@ public class DisplayContentTests extends WindowTestsBase {
        assertTrue(keyguardShowing.getAsBoolean());
        assertFalse(keyguardGoingAway.getAsBoolean());
        assertFalse(appVisible.getAsBoolean());
        if (Flags.ensureKeyguardDoesTransitionStarting()) {
            assertThat(transitions.mLastTransit).isNull();
        } else {
            if (Flags.aodTransition()) {
                assertThat(transitions.mLastTransit).flags().contains(TRANSIT_FLAG_AOD_APPEARING);
            } else {
            assertThat(transitions.mLastTransit).flags().doesNotContain(TRANSIT_FLAG_AOD_APPEARING);
                assertThat(transitions.mLastTransit).flags().doesNotContain(
                        TRANSIT_FLAG_AOD_APPEARING);
            }
        }
        transitions.flush();

@@ -2556,7 +2561,10 @@ public class DisplayContentTests extends WindowTestsBase {
        assertTrue(appVisible.getAsBoolean());

        if (Flags.ensureKeyguardDoesTransitionStarting()) {
            assertThat(transitions.mLastTransit).isNull();
            // Transition will be created due to sleep token updates. But no keyguard transition
            // should be there when the transition is not initiated from the system UI.
            assertThat(transitions.mLastTransit).flags()
                    .doesNotContain(TRANSIT_FLAG_KEYGUARD_GOING_AWAY);
        } else {
            assertThat(transitions.mLastTransit).flags()
                    .containsExactly(TRANSIT_FLAG_KEYGUARD_GOING_AWAY);
@@ -2598,10 +2606,15 @@ public class DisplayContentTests extends WindowTestsBase {
        keyguard.setKeyguardShown(displayId, true /* keyguard */, true /* aod */);
        assertFalse(keyguardGoingAway.getAsBoolean());
        assertFalse(appVisible.getAsBoolean());
        if (!Flags.ensureKeyguardDoesTransitionStarting()) {
            if (Flags.aodTransition()) {
                assertThat(transitions.mLastTransit).flags().contains(TRANSIT_FLAG_AOD_APPEARING);
            } else {
            assertThat(transitions.mLastTransit).flags().doesNotContain(TRANSIT_FLAG_AOD_APPEARING);
                assertThat(transitions.mLastTransit).flags().doesNotContain(
                        TRANSIT_FLAG_AOD_APPEARING);
            }
        } else {
            assertThat(transitions.mLastTransit).isNull();
        }
        transitions.flush();