From 7d608423b721e0153f37bfd5eba78fcd2489562d Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Sun, 7 Aug 2011 16:24:18 -0700 Subject: Move OOM kernel settings to activity manager. The activity manager now take care of plugging the correct settings into the OOM killer in the kernel. This is a lot cleaner because it is really central to how the activity manager works, and nobody else cares about them. Taking advantage of this, the activity manager computes what it thinks are appropriate OOM levels based on the RAM and display size of the device. Also a small optization to the package manager to keep a binding to the package install helper for a bit after done using it, to avoid thrashing on it. And some new APIs that are now needed by Settings. Change-Id: I2b2d379194445d8305bde331c19bde91c8f24751 --- core/java/android/app/ActivityManager.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'core/java/android/app/ActivityManager.java') diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index d207a0a..f7e5cf1 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -864,6 +864,15 @@ public class ActivityManager { */ public boolean lowMemory; + /** @hide */ + public long hiddenAppThreshold; + /** @hide */ + public long secondaryServerThreshold; + /** @hide */ + public long visibleAppThreshold; + /** @hide */ + public long foregroundAppThreshold; + public MemoryInfo() { } @@ -875,12 +884,20 @@ public class ActivityManager { dest.writeLong(availMem); dest.writeLong(threshold); dest.writeInt(lowMemory ? 1 : 0); + dest.writeLong(hiddenAppThreshold); + dest.writeLong(secondaryServerThreshold); + dest.writeLong(visibleAppThreshold); + dest.writeLong(foregroundAppThreshold); } public void readFromParcel(Parcel source) { availMem = source.readLong(); threshold = source.readLong(); lowMemory = source.readInt() != 0; + hiddenAppThreshold = source.readLong(); + secondaryServerThreshold = source.readLong(); + visibleAppThreshold = source.readLong(); + foregroundAppThreshold = source.readLong(); } public static final Creator CREATOR -- cgit v1.1