diff options
| author | 2016-05-23 10:56:33 -0700 | |
|---|---|---|
| committer | 2016-05-23 10:56:33 -0700 | |
| commit | cac5c322da0b81a1a2106c8e248b0fe476f1ea6b (patch) | |
| tree | a6ff53227191ada1a42fa4bff141b94b12203003 | |
| parent | 8c09c7dd7a8838383a94ef85974a8ff0841dd8c5 (diff) | |
Only resuming starting dontWaitForPause activity once
For a starting activity that doesn't wait for pause, we can resume it
when ensuring visible activities when pausing back stacks. If this
happens, there is no need to try to resume it again.
Bug: 28853615
Change-Id: Iee40b80eb13ab3fd65fdce0c100c4051e64f229f
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityStack.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 9718ae86d42e..8b637e0ae44d 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -2258,6 +2258,20 @@ final class ActivityStack { } if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked(); return true; + } else if (mResumedActivity == next && next.state == ActivityState.RESUMED && + mStackSupervisor.allResumedActivitiesComplete()) { + // It is possible for the activity to be resumed when we paused back stacks above if the + // next activity doesn't have to wait for pause to complete. + // So, nothing else to-do except: + // Make sure we have executed any pending transitions, since there + // should be nothing left to do at this point. + mWindowManager.executeAppTransition(); + mNoAnimActivities.clear(); + ActivityOptions.abort(options); + if (DEBUG_STATES) Slog.d(TAG_STATES, + "resumeTopActivityLocked: Top activity resumed (dontWaitForPause) " + next); + if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked(); + return true; } // If the most recent activity was noHistory but was only stopped rather |