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

Commit 5256ae4a authored by Robin Lee's avatar Robin Lee
Browse files

Prioritize keyguard going-away over occlude transition

If the occluding/unoccluding activity is dismissing the keyguard,
we want to play the dismissing-keyguard animation and then reset
mKeyguardGoingAway, rather than just playing an occlusion animation
and leaving mKeyguardGoingAway permanently set.

Bug: 355617360
Test: atest CtsWindowManagerDeviceKeyguard
Flag: EXEMPT bugfix
Change-Id: Ib11609c5ca82c5318a94faa3bf3fdc1f7bbe7192
parent d7a39f77
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -416,8 +416,9 @@ class KeyguardController {
        }

        final TransitionController tc = mRootWindowContainer.mTransitionController;
        final KeyguardDisplayState state = getDisplayState(displayId);

        final boolean occluded = getDisplayState(displayId).mOccluded;
        final boolean occluded = state.mOccluded;
        final boolean performTransition = isKeyguardLocked(displayId);
        final boolean executeTransition = performTransition && !tc.isCollecting();

@@ -461,7 +462,7 @@ class KeyguardController {
    /**
     * Called when keyguard going away state changed.
     */
    private void handleKeyguardGoingAwayChanged(DisplayContent dc) {
    private void handleDismissInsecureKeyguard(DisplayContent dc) {
        mService.deferWindowLayout();
        try {
            dc.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY, 0 /* transitFlags */);
@@ -705,16 +706,16 @@ class KeyguardController {
            }

            boolean hasChange = false;
            if (lastOccluded != mOccluded) {
                writeEventLog("updateVisibility");
                controller.handleOccludedChanged(mDisplayId, mTopOccludesActivity);
                hasChange = true;
            } else if (!lastKeyguardGoingAway && mKeyguardGoingAway) {
            if (!lastKeyguardGoingAway && mKeyguardGoingAway) {
                writeEventLog("dismissIfInsecure");
                controller.handleKeyguardGoingAwayChanged(display);
                controller.handleDismissInsecureKeyguard(display);
                hasChange = true;
            } else if (lastOccluded != mOccluded) {
                controller.handleOccludedChanged(mDisplayId, mTopOccludesActivity);
                hasChange = true;
            }
            // Collect the participates for shell transition, so that transition won't happen too

            // Collect the participants for shell transition, so that transition won't happen too
            // early since the transition was set ready.
            if (hasChange && top != null && (mOccluded || mKeyguardGoingAway)) {
                display.mTransitionController.collect(top);