am 994e3990: am 2adec762: Merge "Fix issue #2621809: Kill! Kill! Kill!" into froyo

Merge commit '994e39908b167fb70883ce6c1146433e0486e86f' into kraken

* commit '994e39908b167fb70883ce6c1146433e0486e86f':
  Fix issue #2621809: Kill! Kill! Kill!
This commit is contained in:
Dianne Hackborn
2010-04-23 14:28:52 -07:00
committed by Android Git Automerger
2 changed files with 15 additions and 8 deletions

View File

@@ -14271,14 +14271,17 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
} }
} }
if (app.curAdj >= HIDDEN_APP_MIN_ADJ) { if (app.curAdj >= HIDDEN_APP_MIN_ADJ) {
numHidden++; if (!app.killedBackground) {
if (numHidden > MAX_HIDDEN_APPS) { numHidden++;
Slog.i(TAG, "Kill " + app.processName if (numHidden > MAX_HIDDEN_APPS) {
+ " (pid " + app.pid + "): hidden #" + numHidden Slog.i(TAG, "Kill " + app.processName
+ " beyond limit " + MAX_HIDDEN_APPS); + " (pid " + app.pid + "): hidden #" + numHidden
EventLog.writeEvent(EventLogTags.AM_KILL, app.pid, + " beyond limit " + MAX_HIDDEN_APPS);
app.processName, app.setAdj, "too many background"); EventLog.writeEvent(EventLogTags.AM_KILL, app.pid,
Process.killProcess(app.pid); app.processName, app.setAdj, "too many background");
app.killedBackground = true;
Process.killProcess(app.pid);
}
} }
} }
} else { } else {

View File

@@ -64,6 +64,7 @@ class ProcessRecord implements Watchdog.PssRequestor {
boolean setIsForeground; // Running foreground UI when last set? boolean setIsForeground; // Running foreground UI when last set?
boolean foregroundServices; // Running any services that are foreground? boolean foregroundServices; // Running any services that are foreground?
boolean bad; // True if disabled in the bad process list 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 IBinder forcingToForeground;// Token that is forcing this process to be foreground
int adjSeq; // Sequence id for identifying repeated trav int adjSeq; // Sequence id for identifying repeated trav
ComponentName instrumentationClass;// class installed to instrument app 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(prefix); pw.print("persistent="); pw.print(persistent);
pw.print(" removed="); pw.print(removed); pw.print(" removed="); pw.print(removed);
pw.print(" persistentActivities="); pw.println(persistentActivities); pw.print(" persistentActivities="); pw.println(persistentActivities);
if (killedBackground) {
pw.print(prefix); pw.print("killedBackground="); pw.println(killedBackground);
}
if (debugging || crashing || crashDialog != null || notResponding if (debugging || crashing || crashDialog != null || notResponding
|| anrDialog != null || bad) { || anrDialog != null || bad) {
pw.print(prefix); pw.print("debugging="); pw.print(debugging); pw.print(prefix); pw.print("debugging="); pw.print(debugging);