summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/am
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-01-27 22:53:13 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-27 22:53:13 -0800
commit75afc6bfe27bffce1e75dd7107f410754cddbeb7 (patch)
treeb4ecc0bcb69838ed97cc62a82681a55097e9447a /services/java/com/android/server/am
parente579b347529a642dc837c2fc37fb483fb7a17fc7 (diff)
parentf1a9ab2673a2b5e6f684f7ceced177e3fc749ee7 (diff)
downloadframeworks_base-75afc6bfe27bffce1e75dd7107f410754cddbeb7.zip
frameworks_base-75afc6bfe27bffce1e75dd7107f410754cddbeb7.tar.gz
frameworks_base-75afc6bfe27bffce1e75dd7107f410754cddbeb7.tar.bz2
am f1a9ab26: am d23316bc: Merge "Maybe fix issue #3358322: Status and nav bar died while watching youtube" into honeycomb
* commit 'f1a9ab2673a2b5e6f684f7ceced177e3fc749ee7': Maybe fix issue #3358322: Status and nav bar died while watching youtube
Diffstat (limited to 'services/java/com/android/server/am')
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java52
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 da70f61..9e3b9c6 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -11947,28 +11947,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;
@@ -12001,7 +11979,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