Loading boot/boot-image-profile-extra.txt +7 −0 Original line number Diff line number Diff line Loading @@ -87,3 +87,10 @@ HSPLandroid/os/Message;->compareMessages(Landroid/os/Message;Landroid/os/Message # and is captured with the boot image profiling pipeline. HSPLcom/android/internal/pm/SystemFeaturesMetadata;->* Lcom/android/internal/pm/SystemFeaturesMetadata; # These methods were previously direct `native` JNI calls, but were made into # Java wrappers with a recent change. Ensure they're compiled to avoid # regressions on any hot paths. # TOOD(b/417492941): Remove after inclusion in generated boot-image-profile.txt. HSPLandroid/os/Process;->setThreadPriority(II)V HSPLandroid/os/Process;->setThreadPriority(I)V core/java/android/os/Process.java +5 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import android.webkit.WebViewZygote; import com.android.sdksandbox.flags.Flags; import dalvik.annotation.optimization.CriticalNative; import dalvik.annotation.optimization.FastNative; import dalvik.system.VMDebug; import dalvik.system.VMRuntime; Loading Loading @@ -1127,6 +1128,7 @@ public class Process { } } @FastNative private static native void setThreadPriorityNative(int tid, @IntRange(from = -20, to = THREAD_PRIORITY_LOWEST) int priority) throws IllegalArgumentException, SecurityException; Loading @@ -1141,9 +1143,11 @@ public class Process { * @hide */ @RavenwoodRedirect @FastNative public static final native void setCanSelfBackground(boolean backgroundOk); @RavenwoodRedirect @CriticalNative private static native boolean getCanSelfBackground(); /** Loading Loading @@ -1339,6 +1343,7 @@ public class Process { */ @RavenwoodRedirect @IntRange(from = -20, to = THREAD_PRIORITY_LOWEST) @FastNative public static final native int getThreadPriority(int tid) throws IllegalArgumentException; Loading core/jni/android_util_Process.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -551,7 +551,7 @@ static void android_os_Process_setCanSelfBackground(JNIEnv* env, jobject clazz, #endif } static jboolean android_os_Process_getCanSelfBackground(JNIEnv* env, jclass clazz) { static jboolean android_os_Process_getCanSelfBackground(CRITICAL_JNI_PARAMS) { #if GUARD_THREAD_PRIORITY void* bgOk = pthread_getspecific(gBgKey); if (bgOk == ((void*)0xbaad)) { Loading Loading @@ -1408,11 +1408,15 @@ void android_os_Process_freezeCgroupUID(JNIEnv* env, jobject clazz, jint uid, jb static const JNINativeMethod methods[] = { {"getUidForName", "(Ljava/lang/String;)I", (void*)android_os_Process_getUidForName}, {"getGidForName", "(Ljava/lang/String;)I", (void*)android_os_Process_getGidForName}, {"setThreadPriorityNative", "(II)V", (void*)android_os_Process_setThreadPriorityNative}, {"setThreadScheduler", "(III)V", (void*)android_os_Process_setThreadScheduler}, // @FastNative {"setThreadPriorityNative", "(II)V", (void*)android_os_Process_setThreadPriorityNative}, // @FastNative {"getThreadPriority", "(I)I", (void*)android_os_Process_getThreadPriority}, // @FastNative {"setCanSelfBackground", "(Z)V", (void*)android_os_Process_setCanSelfBackground}, // @CriticalNative {"getCanSelfBackground", "()Z", (void*)android_os_Process_getCanSelfBackground}, {"getThreadPriority", "(I)I", (void*)android_os_Process_getThreadPriority}, {"getThreadScheduler", "(I)I", (void*)android_os_Process_getThreadScheduler}, {"setThreadGroup", "(II)V", (void*)android_os_Process_setThreadGroup}, {"setThreadGroupAndCpuset", "(II)V", (void*)android_os_Process_setThreadGroupAndCpuset}, Loading Loading
boot/boot-image-profile-extra.txt +7 −0 Original line number Diff line number Diff line Loading @@ -87,3 +87,10 @@ HSPLandroid/os/Message;->compareMessages(Landroid/os/Message;Landroid/os/Message # and is captured with the boot image profiling pipeline. HSPLcom/android/internal/pm/SystemFeaturesMetadata;->* Lcom/android/internal/pm/SystemFeaturesMetadata; # These methods were previously direct `native` JNI calls, but were made into # Java wrappers with a recent change. Ensure they're compiled to avoid # regressions on any hot paths. # TOOD(b/417492941): Remove after inclusion in generated boot-image-profile.txt. HSPLandroid/os/Process;->setThreadPriority(II)V HSPLandroid/os/Process;->setThreadPriority(I)V
core/java/android/os/Process.java +5 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import android.webkit.WebViewZygote; import com.android.sdksandbox.flags.Flags; import dalvik.annotation.optimization.CriticalNative; import dalvik.annotation.optimization.FastNative; import dalvik.system.VMDebug; import dalvik.system.VMRuntime; Loading Loading @@ -1127,6 +1128,7 @@ public class Process { } } @FastNative private static native void setThreadPriorityNative(int tid, @IntRange(from = -20, to = THREAD_PRIORITY_LOWEST) int priority) throws IllegalArgumentException, SecurityException; Loading @@ -1141,9 +1143,11 @@ public class Process { * @hide */ @RavenwoodRedirect @FastNative public static final native void setCanSelfBackground(boolean backgroundOk); @RavenwoodRedirect @CriticalNative private static native boolean getCanSelfBackground(); /** Loading Loading @@ -1339,6 +1343,7 @@ public class Process { */ @RavenwoodRedirect @IntRange(from = -20, to = THREAD_PRIORITY_LOWEST) @FastNative public static final native int getThreadPriority(int tid) throws IllegalArgumentException; Loading
core/jni/android_util_Process.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -551,7 +551,7 @@ static void android_os_Process_setCanSelfBackground(JNIEnv* env, jobject clazz, #endif } static jboolean android_os_Process_getCanSelfBackground(JNIEnv* env, jclass clazz) { static jboolean android_os_Process_getCanSelfBackground(CRITICAL_JNI_PARAMS) { #if GUARD_THREAD_PRIORITY void* bgOk = pthread_getspecific(gBgKey); if (bgOk == ((void*)0xbaad)) { Loading Loading @@ -1408,11 +1408,15 @@ void android_os_Process_freezeCgroupUID(JNIEnv* env, jobject clazz, jint uid, jb static const JNINativeMethod methods[] = { {"getUidForName", "(Ljava/lang/String;)I", (void*)android_os_Process_getUidForName}, {"getGidForName", "(Ljava/lang/String;)I", (void*)android_os_Process_getGidForName}, {"setThreadPriorityNative", "(II)V", (void*)android_os_Process_setThreadPriorityNative}, {"setThreadScheduler", "(III)V", (void*)android_os_Process_setThreadScheduler}, // @FastNative {"setThreadPriorityNative", "(II)V", (void*)android_os_Process_setThreadPriorityNative}, // @FastNative {"getThreadPriority", "(I)I", (void*)android_os_Process_getThreadPriority}, // @FastNative {"setCanSelfBackground", "(Z)V", (void*)android_os_Process_setCanSelfBackground}, // @CriticalNative {"getCanSelfBackground", "()Z", (void*)android_os_Process_getCanSelfBackground}, {"getThreadPriority", "(I)I", (void*)android_os_Process_getThreadPriority}, {"getThreadScheduler", "(I)I", (void*)android_os_Process_getThreadScheduler}, {"setThreadGroup", "(II)V", (void*)android_os_Process_setThreadGroup}, {"setThreadGroupAndCpuset", "(II)V", (void*)android_os_Process_setThreadGroupAndCpuset}, Loading