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

Commit dce1d3ab authored by Louis Chang's avatar Louis Chang
Browse files

Ensure no resumed activity while staring one in the same TF

An activity was started without pausing the resumed activity in
the TF, which resulted in two resumed activity in the TF.

Bug: 296504990
Test: manually tested
Change-Id: I6184d8ce8d71ce0e02cda9ca975e1bb5dff3fe9d
parent 8fe4e9d9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -801,6 +801,14 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
            return false;
        }

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

        final Task task = r.getTask();
        final Task rootTask = task.getRootTask();