diff options
author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-08-20 20:35:15 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-08-20 20:35:15 +0000 |
commit | a8fc994a61fb989a5dabf038e1b87686fb31e705 (patch) | |
tree | 61df569536980d265a03744bed71d4d55a0e095e /services | |
parent | af153914c7b19b02152607c0239a61eb746b78ed (diff) | |
parent | aba2ab2a1532d321d8ab0702d1e9353df22da386 (diff) | |
download | frameworks_base-a8fc994a61fb989a5dabf038e1b87686fb31e705.zip frameworks_base-a8fc994a61fb989a5dabf038e1b87686fb31e705.tar.gz frameworks_base-a8fc994a61fb989a5dabf038e1b87686fb31e705.tar.bz2 |
Merge "am: Allow more hidden apps on devices with lots of RAM" into cm-10.1
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/am/ProcessList.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/java/com/android/server/am/ProcessList.java b/services/java/com/android/server/am/ProcessList.java index 9e25e30..f76c660 100644 --- a/services/java/com/android/server/am/ProcessList.java +++ b/services/java/com/android/server/am/ProcessList.java @@ -23,6 +23,7 @@ import com.android.internal.util.MemInfoReader; import com.android.server.wm.WindowManagerService; import android.graphics.Point; +import android.os.SystemProperties; import android.util.Slog; import android.view.Display; @@ -101,7 +102,15 @@ class ProcessList { // The maximum number of hidden processes we will keep around before // killing them; this is just a control to not let us go too crazy with // keeping around processes on devices with large amounts of RAM. - static final int MAX_HIDDEN_APPS = 24; + static final int MAX_HIDDEN_APPS; + + static { + // Allow more hidden apps on huge memory devices (1.5GB or higher) + // or fetch from the system property + MemInfoReader mi = new MemInfoReader(); + MAX_HIDDEN_APPS = SystemProperties.getInt("sys.mem.max_hidden_apps", + mi.getTotalSize() > 1572864 ? 40 : 24); + } // We allow empty processes to stick around for at most 30 minutes. static final long MAX_EMPTY_TIME = 30*60*1000; |