diff options
| author | 2020-10-28 05:35:20 +0000 | |
|---|---|---|
| committer | 2020-10-28 05:35:20 +0000 | |
| commit | 9d35f27cb5456f78fa91b07e3e10def649bbfe4d (patch) | |
| tree | 37561fce56d7829513f05d2a8febc9949e37751c | |
| parent | 4fb301efd7e41d027c1e345fa232a6d609206cff (diff) | |
| parent | 9f72932f9d35cebcd128987f88b24293e5c7f1d4 (diff) | |
Merge "Finish fixed rotation of recents if it is invisible"
| -rw-r--r-- | services/core/java/com/android/server/wm/DisplayContent.java | 3 | ||||
| -rw-r--r-- | services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 7641de5ab7b9..26c5d70a2c45 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -5467,7 +5467,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp 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 diff --git a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java index 2985796d005f..8094c9767b39 100644 --- a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java @@ -394,6 +394,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 |