diff options
| author | Olawale Ogunwale <ogunwale@google.com> | 2015-04-06 15:44:24 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-06 15:44:24 +0000 |
| commit | adedb407c5cedaba123ea5f44f3d68fd98e8ee55 (patch) | |
| tree | e1d621ef27eee1efc19ea9d8061d6a7c432e5c3b | |
| parent | 694a8ef93826f517cbaf33eeeb96f34ec1c2533d (diff) | |
| parent | 655ef08144ec0b71a98b6b3a38e50c6b346ae467 (diff) | |
| download | frameworks_base-adedb407c5cedaba123ea5f44f3d68fd98e8ee55.zip frameworks_base-adedb407c5cedaba123ea5f44f3d68fd98e8ee55.tar.gz frameworks_base-adedb407c5cedaba123ea5f44f3d68fd98e8ee55.tar.bz2 | |
am 655ef081: Merge "[ActivityManager] Examine bad process before clean up application record"
* commit '655ef08144ec0b71a98b6b3a38e50c6b346ae467':
[ActivityManager] Examine bad process before clean up application record
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 24c2ad4..bdb0d6b 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -2790,10 +2790,38 @@ public final class ActivityManagerService extends ActivityManagerNative if (!isolated) { app = getProcessRecordLocked(processName, info.uid, keepIfLarge); checkTime(startTime, "startProcess: after getProcessRecord"); + + if ((intentFlags & Intent.FLAG_FROM_BACKGROUND) != 0) { + // If we are in the background, then check to see if this process + // is bad. If so, we will just silently fail. + if (mBadProcesses.get(info.processName, info.uid) != null) { + if (DEBUG_PROCESSES) Slog.v(TAG, "Bad process: " + info.uid + + "/" + info.processName); + return null; + } + } else { + // When the user is explicitly starting a process, then clear its + // crash count so that we won't make it bad until they see at + // least one crash dialog again, and make the process good again + // if it had been bad. + if (DEBUG_PROCESSES) Slog.v(TAG, "Clearing bad process: " + info.uid + + "/" + info.processName); + mProcessCrashTimes.remove(info.processName, info.uid); + if (mBadProcesses.get(info.processName, info.uid) != null) { + EventLog.writeEvent(EventLogTags.AM_PROC_GOOD, + UserHandle.getUserId(info.uid), info.uid, + info.processName); + mBadProcesses.remove(info.processName, info.uid); + if (app != null) { + app.bad = false; + } + } + } } else { // If this is an isolated process, it can't re-use an existing process. app = null; } + // We don't have to do anything more if: // (1) There is an existing application record; and // (2) The caller doesn't think it is dead, OR there is no thread @@ -2827,35 +2855,6 @@ public final class ActivityManagerService extends ActivityManagerNative String hostingNameStr = hostingName != null ? hostingName.flattenToShortString() : null; - if (!isolated) { - if ((intentFlags&Intent.FLAG_FROM_BACKGROUND) != 0) { - // If we are in the background, then check to see if this process - // is bad. If so, we will just silently fail. - if (mBadProcesses.get(info.processName, info.uid) != null) { - if (DEBUG_PROCESSES) Slog.v(TAG, "Bad process: " + info.uid - + "/" + info.processName); - return null; - } - } else { - // When the user is explicitly starting a process, then clear its - // crash count so that we won't make it bad until they see at - // least one crash dialog again, and make the process good again - // if it had been bad. - if (DEBUG_PROCESSES) Slog.v(TAG, "Clearing bad process: " + info.uid - + "/" + info.processName); - mProcessCrashTimes.remove(info.processName, info.uid); - if (mBadProcesses.get(info.processName, info.uid) != null) { - EventLog.writeEvent(EventLogTags.AM_PROC_GOOD, - UserHandle.getUserId(info.uid), info.uid, - info.processName); - mBadProcesses.remove(info.processName, info.uid); - if (app != null) { - app.bad = false; - } - } - } - } - if (app == null) { checkTime(startTime, "startProcess: creating new process record"); app = newProcessRecordLocked(info, processName, isolated, isolatedUid); |
