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

Commit 01be5cd2 authored by Ben Lin's avatar Ben Lin
Browse files

Don't carry out resuming activity in TaskFragment if not ready.

This is checked at ActivityTaskSupervisor, but by that point it is possible all the TaskFragment states have been updated, and so the next time attempting to resume will just no-op. Instead we should exit early if we have signal to defer resume until later.

Test: atest
android.server.wm.activity.lifecycle.ActivityLifecycleTopResumedStateTests#testTopPositionLaunchedBehindLockScreen
Bug: 385864843
Flag: com.android.window.flags.ensure_keyguard_does_transition_starting

Change-Id: I3af7401e5ec1e2379ce5cb74df8c81547ec4ceb2
parent d037da48
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -5255,6 +5255,10 @@ class Task extends TaskFragment {
            return false;
            return false;
        }
        }


        if (!mTaskSupervisor.readyToResume()) {
            return false;
        }

        final ActivityRecord topActivity = topRunningActivity(true /* focusableOnly */);
        final ActivityRecord topActivity = topRunningActivity(true /* focusableOnly */);
        if (topActivity == null) {
        if (topActivity == null) {
            // There are no activities left in this task, let's look somewhere else.
            // There are no activities left in this task, let's look somewhere else.