Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddc8f398 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add @CriticalNative to getNativeTid to improve performance"

parents adcd69c8 530da166
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ public class Binder implements IBinder {
     *
     * @hide
     */
    @CriticalNative
    public static native int getNativeTid();

    // Use a Holder to allow static initialization of Binder in the boot image, and
+2 −1
Original line number Diff line number Diff line
@@ -1048,7 +1048,7 @@ static void android_os_Binder_setExtension(JNIEnv* env, jobject obj, jobject ext
    jbh->setExtension(extension);
}

JNIEXPORT jint JNICALL android_os_Binder_getNativeTid(JNIEnv* env, jobject clazz) {
static jint android_os_Binder_getNativeTid() {
    return (jint)android::base::GetThreadId();
}

@@ -1083,6 +1083,7 @@ static const JNINativeMethod gBinderMethods[] = {
    { "blockUntilThreadAvailable", "()V", (void*)android_os_Binder_blockUntilThreadAvailable },
    { "getExtension", "()Landroid/os/IBinder;", (void*)android_os_Binder_getExtension },
    { "setExtension", "(Landroid/os/IBinder;)V", (void*)android_os_Binder_setExtension },
    // @CriticalNative
    { "getNativeTid", "()I", (void*)android_os_Binder_getNativeTid },
};