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

Commit bf06ab10 authored by Dmitri Plotnikov's avatar Dmitri Plotnikov
Browse files

Remove redundant method Binder.getNativeTid()

Bug: 177257934
Test: atest BinderCallsStatsTest
Change-Id: I797a580e7bf6bc3c7174d061c1cf86bccc5b1f3a
parent 8b1a4d8c
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -122,14 +122,6 @@ public class Binder implements IBinder {

    private static native long getNativeFinalizer();

    /**
     * Returns the TID (task ID) for the current thread. Same as {@link Thread#getNativeTid()}
     *
     * @hide
     */
    @CriticalNative
    public static native int getNativeTid();

    // Use a Holder to allow static initialization of Binder in the boot image, and
    // possibly to avoid some initialization ordering issues.
    private static class NoImagePreloadHolder {
+1 −1
Original line number Diff line number Diff line
@@ -633,7 +633,7 @@ public class BinderCallsStats implements BinderInternal.Observer {
    }

    protected int getNativeTid() {
        return Binder.getNativeTid();
        return Process.myTid();
    }

    /**
+0 −7
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
#include <unistd.h>

#include <android-base/stringprintf.h>
#include <android-base/threads.h>
#include <binder/BpBinder.h>
#include <binder/IInterface.h>
#include <binder/IPCThreadState.h>
@@ -1043,10 +1042,6 @@ static void android_os_Binder_setExtension(JNIEnv* env, jobject obj, jobject ext
    jbh->setExtension(extension);
}

static jint android_os_Binder_getNativeTid() {
    return (jint)android::base::GetThreadId();
}

// ----------------------------------------------------------------------------

static const JNINativeMethod gBinderMethods[] = {
@@ -1079,8 +1074,6 @@ 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 },
};

const char* const kBinderPathName = "android/os/Binder";