diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-01-27 17:17:19 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-01-27 17:17:19 -0800 |
commit | 83a6f450bde23e1bfd07ee1c218dab35053dec76 (patch) | |
tree | 98be4fbf1fe77956ade107e3a3648fc9ef3cce4b /services | |
parent | eea200a96a561d8eb9e26831aa6aaf7ddf6ad5a5 (diff) | |
download | frameworks_base-83a6f450bde23e1bfd07ee1c218dab35053dec76.zip frameworks_base-83a6f450bde23e1bfd07ee1c218dab35053dec76.tar.gz frameworks_base-83a6f450bde23e1bfd07ee1c218dab35053dec76.tar.bz2 |
Maybe fix issue #3358322: Status and nav bar died while watching youtube
Or at least make it better. Now if we get a failure locking the surface,
we mark to do a full relayout pass later to try to get a new good surface.
Also fix some bugs in how activity manager was classifying processes for
their OOM adjustment to make better choices in what to kill.
Change-Id: I8e4aa86744211ba7693f9828291d8bbf2698274f
Diffstat (limited to 'services')
-rwxr-xr-x | services/java/com/android/server/am/ActivityManagerService.java | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 6bb19b0..254a19b 100755 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -11944,28 +11944,6 @@ public final class ActivityManagerService extends ActivityManagerNative adj = FOREGROUND_APP_ADJ; schedGroup = Process.THREAD_GROUP_DEFAULT; app.adjType = "exec-service"; - } else if (app.foregroundServices) { - // The user is aware of this app, so make it visible. - adj = PERCEPTIBLE_APP_ADJ; - schedGroup = Process.THREAD_GROUP_DEFAULT; - app.adjType = "foreground-service"; - } else if (app.forcingToForeground != null) { - // The user is aware of this app, so make it visible. - adj = PERCEPTIBLE_APP_ADJ; - schedGroup = Process.THREAD_GROUP_DEFAULT; - app.adjType = "force-foreground"; - app.adjSource = app.forcingToForeground; - } else if (app == mHeavyWeightProcess) { - // We don't want to kill the current heavy-weight process. - adj = HEAVY_WEIGHT_APP_ADJ; - schedGroup = Process.THREAD_GROUP_BG_NONINTERACTIVE; - app.adjType = "heavy"; - } else if (app == mHomeProcess) { - // This process is hosting what we currently consider to be the - // home app, so we don't want to let it go into the background. - adj = HOME_APP_ADJ; - schedGroup = Process.THREAD_GROUP_BG_NONINTERACTIVE; - app.adjType = "home"; } else if ((N=app.activities.size()) != 0) { // This app is in the background with paused activities. app.hidden = true; @@ -11998,7 +11976,37 @@ public final class ActivityManagerService extends ActivityManagerNative adj = hiddenAdj; app.adjType = "bg-empty"; } + + if (adj > PERCEPTIBLE_APP_ADJ) { + if (app.foregroundServices) { + // The user is aware of this app, so make it visible. + adj = PERCEPTIBLE_APP_ADJ; + schedGroup = Process.THREAD_GROUP_DEFAULT; + app.adjType = "foreground-service"; + } else if (app.forcingToForeground != null) { + // The user is aware of this app, so make it visible. + adj = PERCEPTIBLE_APP_ADJ; + schedGroup = Process.THREAD_GROUP_DEFAULT; + app.adjType = "force-foreground"; + app.adjSource = app.forcingToForeground; + } + } + + if (adj > HEAVY_WEIGHT_APP_ADJ && app == mHeavyWeightProcess) { + // We don't want to kill the current heavy-weight process. + adj = HEAVY_WEIGHT_APP_ADJ; + schedGroup = Process.THREAD_GROUP_BG_NONINTERACTIVE; + app.adjType = "heavy"; + } + if (adj > HOME_APP_ADJ && app == mHomeProcess) { + // This process is hosting what we currently consider to be the + // home app, so we don't want to let it go into the background. + adj = HOME_APP_ADJ; + schedGroup = Process.THREAD_GROUP_BG_NONINTERACTIVE; + app.adjType = "home"; + } + //Slog.i(TAG, "OOM " + app + ": initial adj=" + adj); // By default, we use the computed adjustment. It may be changed if |