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: I01c0f2ee8bd8aa34fa7ab73c320062914bedc8f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Ming-Shin Lu
2022-06-15 15:22:43 +00:00
committed by Automerger Merge Worker
2 changed files with 15 additions and 3 deletions

View File

@@ -4300,9 +4300,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
mTransitionController.collect(tStartingWindow); mTransitionController.collect(tStartingWindow);
tStartingWindow.reparent(this, POSITION_TOP); tStartingWindow.reparent(this, POSITION_TOP);
// Propagate other interesting state between the tokens. If the old token is displayed, // Clear the frozen insets state when transferring the existing starting window to
// we should immediately force the new one to be displayed. If it is animating, we need // the next target activity. In case the frozen state from a trampoline activity
// to move that animation to the new one. // 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) { if (fromActivity.allDrawn) {
allDrawn = true; allDrawn = true;
} }

View File

@@ -2811,12 +2811,18 @@ public class ActivityRecordTests extends WindowTestsBase {
true, false, false, false); true, false, false, false);
waitUntilHandlersIdle(); waitUntilHandlersIdle();
final WindowState startingWindow = activityTop.mStartingWindow;
assertNotNull(startingWindow);
// Make the top one invisible, and try transferring the starting window from the top to the // Make the top one invisible, and try transferring the starting window from the top to the
// bottom one. // bottom one.
activityTop.setVisibility(false, false); activityTop.setVisibility(false, false);
activityBottom.transferStartingWindowFromHiddenAboveTokenIfNeeded(); activityBottom.transferStartingWindowFromHiddenAboveTokenIfNeeded();
waitUntilHandlersIdle(); waitUntilHandlersIdle();
// Expect getFrozenInsetsState will be null when transferring the starting window.
assertNull(startingWindow.getFrozenInsetsState());
// Assert that the bottom window now has the starting window. // Assert that the bottom window now has the starting window.
assertNoStartingWindow(activityTop); assertNoStartingWindow(activityTop);
assertHasStartingWindow(activityBottom); assertHasStartingWindow(activityBottom);