Merge "Remove redundant method Binder.getNativeTid()"
This commit is contained in:
committed by
Android (Google) Code Review
commit
3274f73e97
@@ -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 {
|
||||
|
||||
@@ -633,7 +633,7 @@ public class BinderCallsStats implements BinderInternal.Observer {
|
||||
}
|
||||
|
||||
protected int getNativeTid() {
|
||||
return Binder.getNativeTid();
|
||||
return Process.myTid();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user