Loading core/java/com/android/internal/os/BinderInternal.java +2 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,8 @@ public class BinderInternal { */ public static final native void disableBackgroundScheduling(boolean disable); public static final native void setMaxThreads(int numThreads); static native final void handleGc(); public static void forceGc(String reason) { Loading core/jni/android_util_Binder.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -917,6 +917,12 @@ static void android_os_BinderInternal_disableBackgroundScheduling(JNIEnv* env, IPCThreadState::disableBackgroundScheduling(disable ? true : false); } static void android_os_BinderInternal_setMaxThreads(JNIEnv* env, jobject clazz, jint maxThreads) { ProcessState::self()->setThreadPoolMaxThreadCount(maxThreads); } static void android_os_BinderInternal_handleGc(JNIEnv* env, jobject clazz) { ALOGV("Gc has executed, clearing binder ops"); Loading @@ -930,6 +936,7 @@ static const JNINativeMethod gBinderInternalMethods[] = { { "getContextObject", "()Landroid/os/IBinder;", (void*)android_os_BinderInternal_getContextObject }, { "joinThreadPool", "()V", (void*)android_os_BinderInternal_joinThreadPool }, { "disableBackgroundScheduling", "(Z)V", (void*)android_os_BinderInternal_disableBackgroundScheduling }, { "setMaxThreads", "(I)V", (void*)android_os_BinderInternal_setMaxThreads }, { "handleGc", "()V", (void*)android_os_BinderInternal_handleGc } }; Loading services/java/com/android/server/SystemServer.java +7 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,10 @@ public final class SystemServer { private static final String UNCRYPT_PACKAGE_FILE = "/cache/recovery/uncrypt_file"; private static final String BLOCK_MAP_FILE = "/cache/recovery/block.map"; // maximum number of binder threads used for system_server // will be higher than the system default private static final int sMaxBinderThreads = 31; /** * Default theme used by the system context. This is used to style * system-provided dialogs, such as the Power Off dialog, and other Loading Loading @@ -285,6 +289,9 @@ public final class SystemServer { // Ensure binder calls into the system always run at foreground priority. BinderInternal.disableBackgroundScheduling(true); // Increase the number of binder threads in system_server BinderInternal.setMaxThreads(sMaxBinderThreads); // Prepare the main looper thread (this thread). android.os.Process.setThreadPriority( android.os.Process.THREAD_PRIORITY_FOREGROUND); Loading Loading
core/java/com/android/internal/os/BinderInternal.java +2 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,8 @@ public class BinderInternal { */ public static final native void disableBackgroundScheduling(boolean disable); public static final native void setMaxThreads(int numThreads); static native final void handleGc(); public static void forceGc(String reason) { Loading
core/jni/android_util_Binder.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -917,6 +917,12 @@ static void android_os_BinderInternal_disableBackgroundScheduling(JNIEnv* env, IPCThreadState::disableBackgroundScheduling(disable ? true : false); } static void android_os_BinderInternal_setMaxThreads(JNIEnv* env, jobject clazz, jint maxThreads) { ProcessState::self()->setThreadPoolMaxThreadCount(maxThreads); } static void android_os_BinderInternal_handleGc(JNIEnv* env, jobject clazz) { ALOGV("Gc has executed, clearing binder ops"); Loading @@ -930,6 +936,7 @@ static const JNINativeMethod gBinderInternalMethods[] = { { "getContextObject", "()Landroid/os/IBinder;", (void*)android_os_BinderInternal_getContextObject }, { "joinThreadPool", "()V", (void*)android_os_BinderInternal_joinThreadPool }, { "disableBackgroundScheduling", "(Z)V", (void*)android_os_BinderInternal_disableBackgroundScheduling }, { "setMaxThreads", "(I)V", (void*)android_os_BinderInternal_setMaxThreads }, { "handleGc", "()V", (void*)android_os_BinderInternal_handleGc } }; Loading
services/java/com/android/server/SystemServer.java +7 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,10 @@ public final class SystemServer { private static final String UNCRYPT_PACKAGE_FILE = "/cache/recovery/uncrypt_file"; private static final String BLOCK_MAP_FILE = "/cache/recovery/block.map"; // maximum number of binder threads used for system_server // will be higher than the system default private static final int sMaxBinderThreads = 31; /** * Default theme used by the system context. This is used to style * system-provided dialogs, such as the Power Off dialog, and other Loading Loading @@ -285,6 +289,9 @@ public final class SystemServer { // Ensure binder calls into the system always run at foreground priority. BinderInternal.disableBackgroundScheduling(true); // Increase the number of binder threads in system_server BinderInternal.setMaxThreads(sMaxBinderThreads); // Prepare the main looper thread (this thread). android.os.Process.setThreadPriority( android.os.Process.THREAD_PRIORITY_FOREGROUND); Loading