summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ming-Shin Lu <lumark@google.com> 2022-06-15 15:22:46 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-06-15 15:22:46 +0000
commitaaac8962cdb1fa247924fafa797d2aa84bc85d6f (patch)
tree92ceb9518e2b403a12ca15b7d0007d4af8145d0d
parent25dd21dfd8310d9ef665ba742bbcdcdc8f63fef3 (diff)
parent016c6a7320c8eed8354c63c6db20e7733bb02f61 (diff)
Merge "Fix the startingWindow may clipped during AR#transferStartingWindow" into tm-dev am: 016c6a7320
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18869511 Change-Id: I456bd3e8922781f403bacf7d0ebe3326b2cd8fdf Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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);