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

Commit d601ad11 authored by wilsonshih's avatar wilsonshih
Browse files

Fix task root bounds be overwritten when dismiss split screen.

WindowManagerProxy#applyDismissSplit is getting the root task of
secondary split screen instead of freeHomeAndRecents tasks then set
the bounds to empty, and becuase the transaction is queued with
applySyncTransaction, so even the correct root task bounds should
applied when DividerView#exitSplitMode, the bounds could be
overwritten if the SyncTransactionQueue apply to WM later.

Next time when we start an activity with a new task on the secondary
split screen, the activity will be relaunch because the initialization
bounds is full screen.

Fixes: 158637716
Test: atest ActivityLifecycleSplitScreenTests, repeat several times.
Test: run testResumedWhenRecreatedFromInNonFocusedStack then verify
the bounds of split-screen-secondary doesn't become empty.

Change-Id: Ie344b573f42a47d703ad15f7c1983b6c18905665
parent 79f93b02
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -229,7 +229,11 @@ public class WindowManagerProxy {
        // as a result, the above will not capture any tasks; yet, we need to clean-up the
        // home task bounds.
        List<ActivityManager.RunningTaskInfo> freeHomeAndRecents =
                TaskOrganizer.getRootTasks(Display.DEFAULT_DISPLAY, HOME_AND_RECENTS);
                TaskOrganizer.getRootTasks(DEFAULT_DISPLAY, HOME_AND_RECENTS);
        // Filter out the root split tasks
        freeHomeAndRecents.removeIf(p -> p.token.equals(tiles.mSecondary.token)
                || p.token.equals(tiles.mPrimary.token));

        if (primaryChildren.isEmpty() && secondaryChildren.isEmpty()
                && freeHomeAndRecents.isEmpty()) {
            return;