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

Commit fdfc1787 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Do not hide new adding window for rotated transient launch

The hide operation is mainly used to avoid showing navigation bar
with inconsistent rotation after recents activity switches to next
app. So if the state stays at running recents, let the adding
windows show normally.

Bug: 302249163
Bug: 340979786
Test: Disable home rotation. Launch landscape app.
      Enter recents. Long press power key.
      The power menu should be visible.
Test: atest TransitionTests#testAppTransitionWithRotationChange
Merged-In: I692df7227773ff4ca49ff50a02a2eb300dfcd241
Change-Id: I692df7227773ff4ca49ff50a02a2eb300dfcd241
(cherry picked from commit 7970e4f9)
parent 2674c808
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -653,7 +653,7 @@ class AsyncRotationController extends FadeAnimationController implements Consume
            // by drawing the rotated content before applying projection transaction of display.
            // And it will fade in after the display transition is finished.
            if (mTransitionOp == OP_APP_SWITCH && !mIsStartTransactionCommitted
                    && canBeAsync(w.mToken)) {
                    && canBeAsync(w.mToken) && !mDisplayContent.hasFixedRotationTransientLaunch()) {
                hideImmediately(w.mToken, Operation.ACTION_FADE);
                if (DEBUG) Slog.d(TAG, "Hide on finishDrawing " + w.mToken.getTopChild());
            }
+8 −3
Original line number Diff line number Diff line
@@ -1958,6 +1958,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                && mFixedRotationLaunchingApp != mFixedRotationTransitionListener.mAnimatingRecents;
    }

    /** It usually means whether the recents activity is launching with a different rotation. */
    boolean hasFixedRotationTransientLaunch() {
        return mFixedRotationLaunchingApp != null
                && mTransitionController.isTransientLaunch(mFixedRotationLaunchingApp);
    }

    boolean isFixedRotationLaunchingApp(ActivityRecord r) {
        return mFixedRotationLaunchingApp == r;
    }
@@ -7006,9 +7012,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        boolean shouldDeferRotation() {
            ActivityRecord source = null;
            if (mTransitionController.isShellTransitionsEnabled()) {
                final ActivityRecord r = mFixedRotationLaunchingApp;
                if (r != null && mTransitionController.isTransientLaunch(r)) {
                    source = r;
                if (hasFixedRotationTransientLaunch()) {
                    source = mFixedRotationLaunchingApp;
                }
            } else if (mAnimatingRecents != null && !hasTopFixedRotationLaunchingApp()) {
                source = mAnimatingRecents;