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

Commit a409521d authored by Kazuki Takise's avatar Kazuki Takise
Browse files

Enable PiP for top task before calling WCT#reorder,

When a task is moved to top via WCT#reorder, the task is moved
directly via WC#positionChildAt(), which bypasses the preparation
logic needed for an app behind to enter PiP.

Bug: 327233652
Test: Manual. Apps can enter PiP when another app is moved to top.
Change-Id: Ia2c50af741f12b4768f614cb77d06a4350cdf86f
parent d91903a2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1734,6 +1734,13 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                throw new RuntimeException("Reparenting leaf Tasks is not supported now. " + task);
            }
        } else {
            if (hop.getToTop() && task.isRootTask()) {
                final ActivityRecord pipCandidate = task.findEnterPipOnTaskSwitchCandidate(
                        task.getDisplayArea().getTopRootTask());
                task.enableEnterPipOnTaskSwitch(pipCandidate, task, null /* toFrontActivity */,
                        null /* options */);
            }

            task.getParent().positionChildAt(
                    hop.getToTop() ? POSITION_TOP : POSITION_BOTTOM,
                    task, false /* includingParents */);