diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-04-23 14:20:03 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-04-23 14:20:03 -0700 |
commit | 149427cd903f2100e3cc39bda41b831cd68bc553 (patch) | |
tree | 276cd6696da2ce3e4c5c54b38614fb57b52c56e8 /services | |
parent | bf73bbffc18f5abb5350fa3a410830c05ad10206 (diff) | |
download | frameworks_base-149427cd903f2100e3cc39bda41b831cd68bc553.zip frameworks_base-149427cd903f2100e3cc39bda41b831cd68bc553.tar.gz frameworks_base-149427cd903f2100e3cc39bda41b831cd68bc553.tar.bz2 |
Fix issue #2621809: Kill! Kill! Kill!
Stop! Stop! Stop! Spamming the log.
Change-Id: I13f432b49d8c85165873566d58e2fb2714b1263e
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 19 | ||||
-rw-r--r-- | services/java/com/android/server/am/ProcessRecord.java | 4 |
2 files changed, 15 insertions, 8 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 436bd17..8383ca3 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -14271,14 +14271,17 @@ public final class ActivityManagerService extends ActivityManagerNative implemen } } if (app.curAdj >= HIDDEN_APP_MIN_ADJ) { - numHidden++; - if (numHidden > MAX_HIDDEN_APPS) { - Slog.i(TAG, "Kill " + app.processName - + " (pid " + app.pid + "): hidden #" + numHidden - + " beyond limit " + MAX_HIDDEN_APPS); - EventLog.writeEvent(EventLogTags.AM_KILL, app.pid, - app.processName, app.setAdj, "too many background"); - Process.killProcess(app.pid); + if (!app.killedBackground) { + numHidden++; + if (numHidden > MAX_HIDDEN_APPS) { + Slog.i(TAG, "Kill " + app.processName + + " (pid " + app.pid + "): hidden #" + numHidden + + " beyond limit " + MAX_HIDDEN_APPS); + EventLog.writeEvent(EventLogTags.AM_KILL, app.pid, + app.processName, app.setAdj, "too many background"); + app.killedBackground = true; + Process.killProcess(app.pid); + } } } } else { diff --git a/services/java/com/android/server/am/ProcessRecord.java b/services/java/com/android/server/am/ProcessRecord.java index 28195ce..7620468 100644 --- a/services/java/com/android/server/am/ProcessRecord.java +++ b/services/java/com/android/server/am/ProcessRecord.java @@ -64,6 +64,7 @@ class ProcessRecord implements Watchdog.PssRequestor { boolean setIsForeground; // Running foreground UI when last set? boolean foregroundServices; // Running any services that are foreground? boolean bad; // True if disabled in the bad process list + boolean killedBackground; // True when proc has been killed due to too many bg IBinder forcingToForeground;// Token that is forcing this process to be foreground int adjSeq; // Sequence id for identifying repeated trav ComponentName instrumentationClass;// class installed to instrument app @@ -174,6 +175,9 @@ class ProcessRecord implements Watchdog.PssRequestor { pw.print(prefix); pw.print("persistent="); pw.print(persistent); pw.print(" removed="); pw.print(removed); pw.print(" persistentActivities="); pw.println(persistentActivities); + if (killedBackground) { + pw.print(prefix); pw.print("killedBackground="); pw.println(killedBackground); + } if (debugging || crashing || crashDialog != null || notResponding || anrDialog != null || bad) { pw.print(prefix); pw.print("debugging="); pw.print(debugging); |