Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aaac8962 authored by Ming-Shin Lu's avatar Ming-Shin Lu Committed by Automerger Merge Worker
Browse files

Merge "Fix the startingWindow may clipped during AR#transferStartingWindow"...

Merge "Fix the startingWindow may clipped during AR#transferStartingWindow" into tm-dev am: 016c6a73

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18869511



Change-Id: I456bd3e8922781f403bacf7d0ebe3326b2cd8fdf
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 25dd21df 016c6a73
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -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;
                }
                }
+6 −0
Original line number Original line Diff line number Diff line
@@ -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);