diff options
author | Wale Ogunwale <ogunwale@google.com> | 2015-07-13 23:02:52 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-13 23:02:52 +0000 |
commit | eb2153c700ea8455388be23b37e2efbfe2932d58 (patch) | |
tree | 895ecafffd37d18ec08e172193b774bcc97eb86d /services | |
parent | 3f96f8b2fff2a2a7dc0a44d5f1219da8d7f2a5c2 (diff) | |
parent | 093d8de298c258943ca79c1cf429f5ef5725d1bb (diff) | |
download | frameworks_base-eb2153c700ea8455388be23b37e2efbfe2932d58.zip frameworks_base-eb2153c700ea8455388be23b37e2efbfe2932d58.tar.gz frameworks_base-eb2153c700ea8455388be23b37e2efbfe2932d58.tar.bz2 |
am 093d8de2: Merge "Finish already paused activity if it should be finished after pausing" into mnc-dev
* commit '093d8de298c258943ca79c1cf429f5ef5725d1bb':
Finish already paused activity if it should be finished after pausing
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/am/ActivityStack.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 8c3a950..470bbb0 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -2669,8 +2669,13 @@ final class ActivityStack { if (!r.finishing) { if (!mService.isSleeping()) { if (DEBUG_STATES) Slog.d(TAG_STATES, "no-history finish of " + r); - requestFinishActivityLocked(r.appToken, Activity.RESULT_CANCELED, null, - "stop-no-history", false); + if (requestFinishActivityLocked(r.appToken, Activity.RESULT_CANCELED, null, + "stop-no-history", false)) { + // Activity was finished, no need to continue trying to schedule stop. + adjustFocusedActivityLocked(r, "stopActivityFinished"); + r.resumeKeyDispatchingLocked(); + return; + } } else { if (DEBUG_STATES) Slog.d(TAG_STATES, "Not finishing noHistory " + r + " on stop because we're just sleeping"); @@ -2963,6 +2968,7 @@ final class ActivityStack { r.state = ActivityState.FINISHING; if (mode == FINISH_IMMEDIATELY + || (mode == FINISH_AFTER_PAUSE && prevState == ActivityState.PAUSED) || prevState == ActivityState.STOPPED || prevState == ActivityState.INITIALIZING) { // If this activity is already stopped, we can just finish |