Merge "Finish fixed rotation of recents until transition is done" into rvc-dev am: ee5df39e93
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11818506 Change-Id: If7db2e3c9b6c966f6da43a5e421c96e940194229
This commit is contained in:
@@ -5647,8 +5647,12 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (animatingRecents != null && animatingRecents == mFixedRotationLaunchingApp) {
|
if (animatingRecents != null && animatingRecents == mFixedRotationLaunchingApp) {
|
||||||
// Because it won't affect display orientation, just finish the transform.
|
// The recents activity should be going to be invisible (switch to another app or
|
||||||
animatingRecents.finishFixedRotationTransform();
|
// 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);
|
setFixedRotationLaunchingAppUnchecked(null);
|
||||||
} else {
|
} else {
|
||||||
// If there is already a launching activity that is not the recents, before its
|
// If there is already a launching activity that is not the recents, before its
|
||||||
|
|||||||
@@ -349,11 +349,19 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
|
|||||||
assertEquals(Configuration.ORIENTATION_PORTRAIT,
|
assertEquals(Configuration.ORIENTATION_PORTRAIT,
|
||||||
homeActivity.getConfiguration().orientation);
|
homeActivity.getConfiguration().orientation);
|
||||||
|
|
||||||
// Home activity won't become top (return to landActivity), so its fixed rotation and the
|
// Home activity won't become top (return to landActivity), so the top rotated record should
|
||||||
// top rotated record should be cleared.
|
// be cleared.
|
||||||
mController.cleanupAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION);
|
mController.cleanupAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION);
|
||||||
assertFalse(homeActivity.hasFixedRotationTransform());
|
assertFalse(mDefaultDisplay.isFixedRotationLaunchingApp(homeActivity));
|
||||||
assertFalse(mDefaultDisplay.hasTopFixedRotationLaunchingApp());
|
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
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user