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

Commit f360c91f authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Fixes the regression that the resumed activity not paused beforehand" into main

parents 7a9b3e7c e3582ce4
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -795,11 +795,20 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
            return false;
        }

        // Try pausing the existing resumed activity in the Task if any.
        final Task task = r.getTask();
        if (andResume) {
            // Try pausing the existing resumed activity in the Task if any.
            if (task.pauseActivityIfNeeded(r, "realStart")) {
                return false;
            }
            final TaskFragment taskFragment = r.getTaskFragment();
            if (taskFragment != null && taskFragment.getResumedActivity() != null) {
                if (taskFragment.startPausing(mUserLeaving, false /* uiSleeping */, r,
                        "realStart")) {
                    return false;
                }
            }
        }

        final Task rootTask = task.getRootTask();
        beginDeferResume();