summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java12
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java6
2 files changed, 15 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index ec64cccefd01..5c473d8c67f5 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -4300,9 +4300,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
mTransitionController.collect(tStartingWindow);
tStartingWindow.reparent(this, POSITION_TOP);
- // Propagate other interesting state between the tokens. If the old token is displayed,
- // we should immediately force the new one to be displayed. If it is animating, we need
- // to move that animation to the new one.
+ // Clear the frozen insets state when transferring the existing starting window to
+ // the next target activity. In case the frozen state from a trampoline activity
+ // affecting the starting window frame computation to see the window being
+ // clipped if the rotation change during the transition animation.
+ tStartingWindow.clearFrozenInsetsState();
+
+ // Propagate other interesting state between the tokens. If the old token is
+ // displayed, we should immediately force the new one to be displayed. If it is
+ // animating, we need to move that animation to the new one.
if (fromActivity.allDrawn) {
allDrawn = true;
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
index 8c4a4c9ea284..03d87749072d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
@@ -2811,12 +2811,18 @@ public class ActivityRecordTests extends WindowTestsBase {
true, false, false, false);
waitUntilHandlersIdle();
+ final WindowState startingWindow = activityTop.mStartingWindow;
+ assertNotNull(startingWindow);
+
// Make the top one invisible, and try transferring the starting window from the top to the
// bottom one.
activityTop.setVisibility(false, false);
activityBottom.transferStartingWindowFromHiddenAboveTokenIfNeeded();
waitUntilHandlersIdle();
+ // Expect getFrozenInsetsState will be null when transferring the starting window.
+ assertNull(startingWindow.getFrozenInsetsState());
+
// Assert that the bottom window now has the starting window.
assertNoStartingWindow(activityTop);
assertHasStartingWindow(activityBottom);