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

Commit c911c8dd authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Update display orientation if rotated app is not in transition" into main

parents ddb8f939 2ed3f59c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2908,6 +2908,18 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                && !mDisplayRotation.isRotatingSeamlessly()) {
            clearFixedRotationLaunchingApp();
        }
        // If there won't be a transition to notify the launch is done, then it should be ready to
        // update with display orientation. E.g. a translucent activity enters pip from a task which
        // contains another opaque activity.
        if (mFixedRotationLaunchingApp != null && mFixedRotationLaunchingApp.isVisible()
                && !mTransitionController.isCollecting()
                && !mAtmService.mBackNavigationController.isMonitoringFinishTransition()) {
            final Transition finishTransition = mTransitionController.mFinishingTransition;
            if (finishTransition == null || !finishTransition.mParticipants.contains(
                    mFixedRotationLaunchingApp)) {
                continueUpdateOrientationForDiffOrienLaunchingApp();
            }
        }
    }

    /**
+5 −0
Original line number Diff line number Diff line
@@ -1877,6 +1877,11 @@ public class DisplayContentTests extends WindowTestsBase {
        assertEquals("Display must be portrait after closing the translucent activity",
                Configuration.ORIENTATION_PORTRAIT,
                mDisplayContent.getConfiguration().orientation);

        mDisplayContent.setFixedRotationLaunchingAppUnchecked(nonTopVisible);
        mDisplayContent.onTransitionFinished();
        assertFalse("Complete fixed rotation if not in a transition",
                mDisplayContent.hasTopFixedRotationLaunchingApp());
    }

    @Test