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

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

Merge "Avoid clearing rotation transform too early" into main

parents fecf2507 3230d5b8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2834,7 +2834,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        // If the transition finished callback cannot match the token for some reason, make sure the
        // rotated state is cleared if it is already invisible.
        if (mFixedRotationLaunchingApp != null && !mFixedRotationLaunchingApp.isVisibleRequested()
                && !mFixedRotationLaunchingApp.isVisible()) {
                && !mFixedRotationLaunchingApp.isVisible()
                // In case the next transition still needs the existing transform.
                && !mTransitionController.isCollecting()) {
            clearFixedRotationLaunchingApp();
        }
        // If there won't be a transition to notify the launch is done, then it should be ready to
+10 −0
Original line number Diff line number Diff line
@@ -1320,6 +1320,7 @@ public class TransitionTests extends WindowTestsBase {
        mDisplayContent.setLastHasContent();
        mDisplayContent.requestChangeTransition(1 /* changes */, null /* displayChange */,
                ActionChain.test());
        assertTrue(mDisplayContent.mTransitionController.isCollecting());
        assertNotNull(mDisplayContent.getAsyncRotationController());
        mDisplayContent.setFixedRotationLaunchingAppUnchecked(null);
        assertNull("Clear rotation controller if rotation is not changed",
@@ -1332,6 +1333,15 @@ public class TransitionTests extends WindowTestsBase {
        mDisplayContent.setFixedRotationLaunchingAppUnchecked(null);
        assertNotNull("Keep rotation controller if rotation will be changed",
                mDisplayContent.getAsyncRotationController());

        mDisplayContent.getDisplayRotation().setRotation(
                mDisplayContent.getWindowConfiguration().getRotation());
        app.setVisibleRequested(false);
        app.setVisible(false);
        mDisplayContent.setFixedRotationLaunchingAppUnchecked(app);
        mDisplayContent.onTransitionFinished();
        assertNotNull("Keep rotation controller if a transition is collecting",
                mDisplayContent.getAsyncRotationController());
    }

    @Test