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

Commit 7fd422b1 authored by Evan Rosky's avatar Evan Rosky
Browse files

Don't skip resume on transient-launch activity

When transient-launching, we are trying not to affect any
other lifecycles by pausing things. This should imply that we
shouldn't wait for ongoing pauses since they are independent
of the transient-launch.

deferPause is used to indicate that the current resume won't
pause/wait for the current activity to pause. So, don't wait
for ongoing pauses that started beforehand either.

Bug: 294152870
Bug: 293379641
Test: have a decoupled slow-pausing app's pause (eg. CCT) be
      interrupted by recents entry.
Change-Id: I4a9b44f1f08bfd2e41eee9352588b84ee8cc8a5d
(cherry picked from commit 53cab5ba)
parent 36b663d8
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -1162,7 +1162,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
    }

    final boolean resumeTopActivity(ActivityRecord prev, ActivityOptions options,
            boolean deferPause) {
            boolean skipPause) {
        ActivityRecord next = topRunningActivity(true /* focusableOnly */);
        if (next == null || !next.canResumeByCompat()) {
            return false;
@@ -1170,11 +1170,9 @@ class TaskFragment extends WindowContainer<WindowContainer> {

        next.delayedResume = false;

        // If we are currently pausing an activity, then don't do anything until that is done.
        final boolean allPausedComplete = mRootWindowContainer.allPausedActivitiesComplete();
        if (!allPausedComplete) {
            ProtoLog.v(WM_DEBUG_STATES,
                    "resumeTopActivity: Skip resume: some activity pausing.");
        if (!skipPause && !mRootWindowContainer.allPausedActivitiesComplete()) {
            // If we aren't skipping pause, then we have to wait for currently pausing activities.
            ProtoLog.v(WM_DEBUG_STATES, "resumeTopActivity: Skip resume: some activity pausing.");
            return false;
        }

@@ -1238,7 +1236,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
            lastResumed = lastFocusedRootTask.getTopResumedActivity();
        }

        boolean pausing = !deferPause && taskDisplayArea.pauseBackTasks(next);
        boolean pausing = !skipPause && taskDisplayArea.pauseBackTasks(next);
        if (mResumedActivity != null) {
            ProtoLog.d(WM_DEBUG_STATES, "resumeTopActivity: Pausing %s", mResumedActivity);
            pausing |= startPausing(mTaskSupervisor.mUserLeaving, false /* uiSleeping */,