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

Commit 15cde45d authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Corrects wrong activity sent for resume in canMoveTaskToBack" into main

parents 7a104e8f 8d079964
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -5764,15 +5764,16 @@ class Task extends TaskFragment {
            return false;
        }

        // If we have a watcher, preflight the move before committing to it.  First check
        // for *other* available tasks, but if none are available, then try again allowing the
        // current task to be selected.
        // If we have a watcher, preflight the move before committing to it.
        // Checks for other available tasks; however, if none are available, skips because this
        // is the bottommost task.
        if (mAtmService.mController != null && isTopRootTaskInDisplayArea()) {
            ActivityRecord next = topRunningActivity(null, task.mTaskId);
            if (next == null) {
                next = topRunningActivity(null, INVALID_TASK_ID);
            }
            final ActivityRecord next = getDisplayArea().getActivity(
                    a -> isTopRunning(a, task.mTaskId, null /* notTop */));
            if (next != null) {
                if (next.isState(RESUMED)) {
                    return true;
                }
                // ask watcher if this is allowed
                boolean moveOK = true;
                try {