diff options
author | Dianne Hackborn <hackbod@google.com> | 2009-12-07 17:59:37 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2009-12-07 19:11:14 -0800 |
commit | 887f355f99ff83d568ef2885a4fdcaae475583df (patch) | |
tree | c4788aa9ac8f37c6a02fc6b3a6874b71efb0f759 /core/jni/android_util_Binder.cpp | |
parent | 259e3384face72ea8e30696d7bae492d37d44e8b (diff) | |
download | frameworks_base-887f355f99ff83d568ef2885a4fdcaae475583df.zip frameworks_base-887f355f99ff83d568ef2885a4fdcaae475583df.tar.gz frameworks_base-887f355f99ff83d568ef2885a4fdcaae475583df.tar.bz2 |
Propagate background scheduling class across processes.
This is a very simply implementation: upon receiving an IPC, if the handling
thread is at a background priority (the driver will have taken care of
propagating this from the calling thread), then stick it in to the background
scheduling group. Plus an API to turn this off for the process, which is
used by the system process.
This also pulls some of the code for managing scheduling classes out of
the Process JNI wrappers and in to some convenience methods in thread.h.
Diffstat (limited to 'core/jni/android_util_Binder.cpp')
-rw-r--r-- | core/jni/android_util_Binder.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp index f0885fd..627fcbf 100644 --- a/core/jni/android_util_Binder.cpp +++ b/core/jni/android_util_Binder.cpp @@ -670,6 +670,12 @@ static void android_os_BinderInternal_joinThreadPool(JNIEnv* env, jobject clazz) android::IPCThreadState::self()->joinThreadPool(); } +static void android_os_BinderInternal_disableBackgroundScheduling(JNIEnv* env, + jobject clazz, jboolean disable) +{ + IPCThreadState::disableBackgroundScheduling(disable ? true : false); +} + static void android_os_BinderInternal_handleGc(JNIEnv* env, jobject clazz) { LOGV("Gc has executed, clearing binder ops"); @@ -682,6 +688,7 @@ static const JNINativeMethod gBinderInternalMethods[] = { /* name, signature, funcPtr */ { "getContextObject", "()Landroid/os/IBinder;", (void*)android_os_BinderInternal_getContextObject }, { "joinThreadPool", "()V", (void*)android_os_BinderInternal_joinThreadPool }, + { "disableBackgroundScheduling", "(Z)V", (void*)android_os_BinderInternal_disableBackgroundScheduling }, { "handleGc", "()V", (void*)android_os_BinderInternal_handleGc } }; |