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

Commit 829852a7 authored by Ben Lin's avatar Ben Lin
Browse files

Sync mLastLeafTaskToFrontId to moveTaskToFront callback.

When moving the task to the back and trying to update the new task
moving to the front, instead of invalidating the taskId, we should
update it to the one that's about to be moved to the front.

Bug: 408967675
Bug: 409160132
Test: Manual - Enter PiP while in Desktop mode (via minimize), close
PiP, swipe up to Overview to verify no UI issue
Flag: EXEMPT bug fix

Change-Id: I62ec04833989cc2d56dd67f271a58b958795293e
parent 72c7db4c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -415,14 +415,15 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {

        if (!toTop) {
            if (t.mTaskId == mLastLeafTaskToFrontId) {
                mLastLeafTaskToFrontId = INVALID_TASK_ID;

                // If the previous front-most task is moved to the back, then notify of the new
                // front-most task.
                final ActivityRecord topMost = getTopNonFinishingActivity();
                if (topMost != null) {
                    mAtmService.getTaskChangeNotificationController().notifyTaskMovedToFront(
                            topMost.getTask().getTaskInfo());
                    mLastLeafTaskToFrontId = topMost.getTask().mTaskId;
                } else {
                    mLastLeafTaskToFrontId = INVALID_TASK_ID;
                }
            }
            return;