diff options
| author | Dianne Hackborn <hackbod@google.com> | 2011-07-13 19:33:41 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2011-07-14 10:39:39 -0700 |
| commit | ce86ba86df61de8b34b226a4eb6c23ec33e866e0 (patch) | |
| tree | bd6a8d599da38dd78c28f82cf0575b4294ff7199 /core/java/android/app/ApplicationThreadNative.java | |
| parent | f7537bccb2b2ca2fa6c0205c4b24acd0836c0006 (diff) | |
Improve handling of low memory.
Now classify background processes into a set of bins of how much
memory they should try to clear. The last bin also involves
destroying all activities in that process.
Removed the old code for the simulator that is no longer needed
(yay). The debugging features it had are now integrated into the
regular oom adj code.
Small fixes to load average service.
Change-Id: Ic8df401714b188c73b50dbc8f8e6345b58f1f3a0
Diffstat (limited to 'core/java/android/app/ApplicationThreadNative.java')
| -rw-r--r-- | core/java/android/app/ApplicationThreadNative.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index dc0f5298d2b0..16181e0e8742 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -478,6 +478,13 @@ public abstract class ApplicationThreadNative extends Binder updatePackageCompatibilityInfo(pkg, compat); return true; } + + case SCHEDULE_TRIM_MEMORY_TRANSACTION: { + data.enforceInterface(IApplicationThread.descriptor); + int level = data.readInt(); + scheduleTrimMemory(level); + return true; + } } return super.onTransact(code, data, reply, flags); @@ -989,4 +996,12 @@ class ApplicationThreadProxy implements IApplicationThread { mRemote.transact(UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); } + + public void scheduleTrimMemory(int level) throws RemoteException { + Parcel data = Parcel.obtain(); + data.writeInterfaceToken(IApplicationThread.descriptor); + data.writeInt(level); + mRemote.transact(SCHEDULE_TRIM_MEMORY_TRANSACTION, data, null, + IBinder.FLAG_ONEWAY); + } } |
