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

Commit f34c6021 authored by Winson Chung's avatar Winson Chung
Browse files

Fix issue with reparenting stacks on displays.

Bug: 72489026
Test: ActivityManagerMultiDisplayTests
Change-Id: I04d5971206b3b31ee349733de623edfff4c97222
parent cbb15a99
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -642,7 +642,10 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
        // TODO: We should probably resolve the windowing mode for the stack on the new display here
        // so that it end up in a compatible mode in the new display. e.g. split-screen secondary.
        removeFromDisplay();
        // Reparent the window container before we try to update the position when adding it to
        // the new display below
        mTmpRect2.setEmpty();
        mWindowContainerController.reparent(activityDisplay.mDisplayId, mTmpRect2, onTop);
        postAddToDisplay(activityDisplay, mTmpRect2.isEmpty() ? null : mTmpRect2, onTop);
        adjustFocusToNextFocusableStack("reparent", true /* allowFocusSelf */);
        mStackSupervisor.resumeFocusedStackTopActivityLocked();
@@ -650,7 +653,6 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
        // windows that are no longer visible.
        mStackSupervisor.ensureActivitiesVisibleLocked(null /* starting */, 0 /* configChanges */,
                !PRESERVE_WINDOWS);
        mWindowContainerController.reparent(activityDisplay.mDisplayId, mTmpRect2, onTop);
    }

    /**