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

Commit f439b98e authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Finish fixed rotation of recents until transition is done" into...

Merge "Merge "Finish fixed rotation of recents until transition is done" into rvc-dev am: ee5df39e am: 82b9966f" into rvc-d1-dev-plus-aosp
parents c45b269a 0315917f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -5647,8 +5647,12 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            }

            if (animatingRecents != null && animatingRecents == mFixedRotationLaunchingApp) {
                // Because it won't affect display orientation, just finish the transform.
                animatingRecents.finishFixedRotationTransform();
                // The recents activity should be going to be invisible (switch to another app or
                // return to original top). Only clear the top launching record without finishing
                // the transform immediately because it won't affect display orientation. And before
                // the visibility is committed, the recents activity may perform relayout which may
                // cause unexpected configuration change if the rotated configuration is restored.
                // The transform will be finished when the transition is done.
                setFixedRotationLaunchingAppUnchecked(null);
            } else {
                // If there is already a launching activity that is not the recents, before its
+11 −3
Original line number Diff line number Diff line
@@ -349,11 +349,19 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
        assertEquals(Configuration.ORIENTATION_PORTRAIT,
                homeActivity.getConfiguration().orientation);

        // Home activity won't become top (return to landActivity), so its fixed rotation and the
        // top rotated record should be cleared.
        // Home activity won't become top (return to landActivity), so the top rotated record should
        // be cleared.
        mController.cleanupAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION);
        assertFalse(homeActivity.hasFixedRotationTransform());
        assertFalse(mDefaultDisplay.isFixedRotationLaunchingApp(homeActivity));
        assertFalse(mDefaultDisplay.hasTopFixedRotationLaunchingApp());
        // The transform should keep until the transition is done, so the restored configuration
        // won't be sent to activity and cause unnecessary configuration change.
        assertTrue(homeActivity.hasFixedRotationTransform());

        // In real case the transition will be executed from RecentsAnimation#finishAnimation.
        mDefaultDisplay.mFixedRotationTransitionListener.onAppTransitionFinishedLocked(
                homeActivity.token);
        assertFalse(homeActivity.hasFixedRotationTransform());
    }

    @Test