diff options
author | Olawale Ogunwale <ogunwale@google.com> | 2015-04-02 16:39:18 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-02 16:39:18 +0000 |
commit | e4d4e22f26bfd36a553fb24232d2fd4ddf4fc907 (patch) | |
tree | ed30e32409e194723d6ccd10d9ca2db0f2959569 | |
parent | 64c8a07345cb7cb01b3e98442b52c51d473fbf2d (diff) | |
parent | 558e849a7772cda924ac0617708c439ed05c17ed (diff) | |
download | frameworks_base-e4d4e22f26bfd36a553fb24232d2fd4ddf4fc907.zip frameworks_base-e4d4e22f26bfd36a553fb24232d2fd4ddf4fc907.tar.gz frameworks_base-e4d4e22f26bfd36a553fb24232d2fd4ddf4fc907.tar.bz2 |
Merge "[ActivityManager] Avoid improper resume top activity."
-rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 18 | ||||
-rw-r--r-- | services/core/java/com/android/server/am/ActivityStack.java | 6 |
2 files changed, 10 insertions, 14 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index f5a9847..bcbc54b 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -4592,17 +4592,13 @@ public final class ActivityManagerService extends ActivityManagerNative finishInstrumentationLocked(app, Activity.RESULT_CANCELED, info); } - if (!restarting) { - if (!mStackSupervisor.resumeTopActivitiesLocked()) { - // If there was nothing to resume, and we are not already - // restarting this process, but there is a visible activity that - // is hosted by the process... then make sure all visible - // activities are running, taking care of restarting this - // process. - if (hasVisibleActivities) { - mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); - } - } + if (!restarting && hasVisibleActivities && !mStackSupervisor.resumeTopActivitiesLocked()) { + // If there was nothing to resume, and we are not already + // restarting this process, but there is a visible activity that + // is hosted by the process... then make sure all visible + // activities are running, taking care of restarting this + // process. + mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); } } diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 9f22aa9..82c71e3 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -3390,6 +3390,9 @@ final class ActivityStack { if (DEBUG_CLEANUP) Slog.v( TAG, "Record #" + i + " " + r + ": app=" + r.app); if (r.app == app) { + if (r.visible) { + hasVisibleActivities = true; + } boolean remove; if ((!r.haveState && !r.stateNotNeeded) || r.finishing) { // Don't currently have state for the activity, or @@ -3431,9 +3434,6 @@ final class ActivityStack { // it can be restarted later when needed. if (localLOGV) Slog.v( TAG, "Keeping entry, setting app to null"); - if (r.visible) { - hasVisibleActivities = true; - } if (DEBUG_APP) Slog.v(TAG, "Clearing app during removeHistory for activity " + r); r.app = null; |