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

Commit ec4f83ae authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Collect transition participant when moving to a different display

So the transition has a chance to reset the crop according to the
latest bounds. Or play corresponding animation even if the container
configuration is not changed.

Fix: 373410849
Flag: EXEMPT bugfix
Test: atest TransitionTests#testCollectReparentChange
Change-Id: Iba774557bb5ed8774d8e6b5c0bc72e8761628da6
parent 8ac5a154
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1792,8 +1792,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
        prevDc.onRunningActivityChanged();

        // TODO(b/169035022): move to a more-appropriate place.
        mTransitionController.collect(this);
        if (prevDc.mOpeningApps.remove(this)) {
            // Transfer opening transition to new display.
            mDisplayContent.mOpeningApps.add(this);
+1 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
     */
    void onDisplayChanged(DisplayContent dc) {
        if (mDisplayContent != null && mDisplayContent != dc) {
            mTransitionController.collect(this);
            // Cancel any change transition queued-up for this container on the old display when
            // this container is moved from the old display.
            mDisplayContent.mClosingChangingContainers.remove(this);
+5 −0
Original line number Diff line number Diff line
@@ -2354,6 +2354,11 @@ public class TransitionTests extends WindowTestsBase {
        // ChangeInfo#mCommonAncestor should be set after reparent.
        final Transition.ChangeInfo change = transition.mChanges.get(activity);
        assertEquals(newParent.getDisplayArea(), change.mCommonAncestor);

        // WindowContainer#onDisplayChanged should collect the moved task.
        final DisplayContent newDisplay = createNewDisplay();
        newParent.reparent(newDisplay.getDefaultTaskDisplayArea(), true /* onTop */);
        assertTrue(transition.mParticipants.contains(newParent));
    }

    @Test