diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-07-29 01:25:18 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-07-29 02:06:46 -0700 |
commit | c68c913d357e2955d4bd7ca52829071e531c7825 (patch) | |
tree | 764dddf699a1db5e44d74e94e3f354b9ed61ff71 /core/java/android/app/ContextImpl.java | |
parent | 3970f6833d3c19f96cc7b6831327c8488932fa57 (diff) | |
download | frameworks_base-c68c913d357e2955d4bd7ca52829071e531c7825.zip frameworks_base-c68c913d357e2955d4bd7ca52829071e531c7825.tar.gz frameworks_base-c68c913d357e2955d4bd7ca52829071e531c7825.tar.bz2 |
Various work on out of memory managment.
- Improve how we handle processes that have shown UI, to take care
of more cases where we want to push them into the background LRU
list.
- New trim memory level for when an application that has done UI
is no longer visible to the user.
- Add APIs to get new trim memory callback.
- Add a host of new bind flags to tweak how the system will adjust
the OOM level of the target process.
Change-Id: I23ba354112f411a9f8773a67426b4dff85fa2439
Diffstat (limited to 'core/java/android/app/ContextImpl.java')
-rw-r--r-- | core/java/android/app/ContextImpl.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index a99cec2..b4bdb2f 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -1109,6 +1109,12 @@ class ContextImpl extends Context { throw new RuntimeException("Not supported in system context"); } try { + IBinder token = getActivityToken(); + if (token == null && (flags&BIND_AUTO_CREATE) == 0 && mPackageInfo != null + && mPackageInfo.getApplicationInfo().targetSdkVersion + < android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + flags |= BIND_WAIVE_PRIORITY; + } int res = ActivityManagerNative.getDefault().bindService( mMainThread.getApplicationThread(), getActivityToken(), service, service.resolveTypeIfNeeded(getContentResolver()), |