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

Commit b961c4ef authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Finish fixed rotation of recents if it is invisible am: 8f692ef0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12937635

Change-Id: I034100253052bef011d70f062744244e705045ca
parents 95b84b68 8f692ef0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5703,7 +5703,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                return;
            }

            if (animatingRecents != null && animatingRecents == mFixedRotationLaunchingApp) {
            if (animatingRecents != null && animatingRecents == mFixedRotationLaunchingApp
                    && animatingRecents.isVisible()) {
                // 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
+15 −0
Original line number Diff line number Diff line
@@ -395,6 +395,21 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
        // The rotation transform should be cleared after updating orientation with display.
        assertFalse(activity.hasFixedRotationTransform());
        assertFalse(mDefaultDisplay.hasTopFixedRotationLaunchingApp());

        // Simulate swiping up recents (home) in different rotation.
        final ActivityRecord home = mDefaultDisplay.getDefaultTaskDisplayArea().getHomeActivity();
        mDefaultDisplay.setFixedRotationLaunchingApp(home, (mDefaultDisplay.getRotation() + 1) % 4);
        mController = new RecentsAnimationController(mWm, mMockRunner, mAnimationCallbacks,
                mDefaultDisplay.getDisplayId());
        initializeRecentsAnimationController(mController, home);
        assertTrue(home.hasFixedRotationTransform());

        // Assume recents activity becomes invisible for some reason (e.g. screen off).
        home.setVisible(false);
        mController.cleanupAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION);
        // Although there won't be a transition finish callback, the fixed rotation must be cleared.
        assertFalse(home.hasFixedRotationTransform());
        assertFalse(mDefaultDisplay.hasTopFixedRotationLaunchingApp());
    }

    @Test