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

Commit 42840dff authored by Evan Rosky's avatar Evan Rosky
Browse files

Make sure keyguard knows about all occluded state changes

If the transition is a de-facto occlude/unocclude transition,
the transition itself will update keyguard occlusion state in
sync. However, if occlusion state changes in a different transition,
we have to notify keyguard directly or it might get stuck in
one state or another.

Bug: 266384300
Test: atest FlickerTest:OpenAppNonResizeableTest
Change-Id: Ie45ee7f99332cd083b92a9c348f0e4119757c8f1
parent 4ee917db
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_IS_RECENTS;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_LOCKED;
import static android.view.WindowManager.TRANSIT_KEYGUARD_OCCLUDE;
import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
@@ -1302,8 +1304,13 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
    private void handleNonAppWindowsInTransition(@NonNull DisplayContent dc,
            @TransitionType int transit, @TransitionFlags int flags) {
        if ((flags & TRANSIT_FLAG_KEYGUARD_LOCKED) != 0) {
            mController.mAtm.mWindowManager.mPolicy.applyKeyguardOcclusionChange(
                    false /* notify */);
            // If the occlusion changed but the transition isn't an occlude/unocclude transition,
            // then we have to notify KeyguardService directly. This can happen if there is
            // another ongoing transition when the app changes occlusion OR if the app dies or
            // is killed. Both of these are common during tests.
            final boolean notify = !(transit == TRANSIT_KEYGUARD_OCCLUDE
                    || transit == TRANSIT_KEYGUARD_UNOCCLUDE);
            mController.mAtm.mWindowManager.mPolicy.applyKeyguardOcclusionChange(notify);
        }
    }

+0 −9
Original line number Diff line number Diff line
@@ -24,12 +24,10 @@ import com.android.server.wm.flicker.FlickerTest
import com.android.server.wm.flicker.FlickerTestFactory
import com.android.server.wm.flicker.annotation.FlickerServiceCompatible
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
import com.android.server.wm.traces.common.ComponentNameMatcher
import com.android.server.wm.traces.common.service.PlatformConsts
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test
@@ -67,13 +65,6 @@ import org.junit.runners.Parameterized
open class OpenAppNonResizeableTest(flicker: FlickerTest) : OpenAppFromLockTransition(flicker) {
    override val testApp = NonResizeableAppHelper(instrumentation)

    @Before
    open fun before() {
        // b/266384300 - The test causes the keyguard occluded state to be incorrect, disable
        // it while enabling shell transitions
        Assume.assumeFalse(isShellTransitionsEnabled)
    }

    /**
     * Checks that the [ComponentNameMatcher.NAV_BAR] layer starts invisible, becomes visible during
     * unlocking animation and remains visible at the end