Loading core/java/android/os/Binder.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -313,7 +313,7 @@ public class Binder implements IBinder { * @hide * @hide */ */ @CriticalNative @CriticalNative public static final native boolean isHandlingTransaction(); public static final native boolean isDirectlyHandlingTransaction(); /** /** * Return the Linux uid assigned to the process that sent the transaction * Return the Linux uid assigned to the process that sent the transaction Loading @@ -323,7 +323,7 @@ public class Binder implements IBinder { * executing an incoming transaction. * executing an incoming transaction. */ */ public static final int getCallingUidOrThrow() { public static final int getCallingUidOrThrow() { if (!isHandlingTransaction()) { if (!isDirectlyHandlingTransaction()) { throw new IllegalStateException( throw new IllegalStateException( "Thread is not in a binder transcation"); "Thread is not in a binder transcation"); } } Loading core/jni/android_util_Binder.cpp +4 −3 Original line number Original line Diff line number Diff line Loading @@ -959,8 +959,7 @@ static jint android_os_Binder_getCallingUid() return IPCThreadState::self()->getCallingUid(); return IPCThreadState::self()->getCallingUid(); } } static jboolean android_os_Binder_isHandlingTransaction() static jboolean android_os_Binder_isDirectlyHandlingTransaction() { { return getCurrentServingCall() == BinderCallType::BINDER; return getCurrentServingCall() == BinderCallType::BINDER; } } Loading Loading @@ -1056,6 +1055,7 @@ static void android_os_Binder_setExtension(JNIEnv* env, jobject obj, jobject ext // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // clang-format off static const JNINativeMethod gBinderMethods[] = { static const JNINativeMethod gBinderMethods[] = { /* name, signature, funcPtr */ /* name, signature, funcPtr */ // @CriticalNative // @CriticalNative Loading @@ -1063,7 +1063,7 @@ static const JNINativeMethod gBinderMethods[] = { // @CriticalNative // @CriticalNative { "getCallingUid", "()I", (void*)android_os_Binder_getCallingUid }, { "getCallingUid", "()I", (void*)android_os_Binder_getCallingUid }, // @CriticalNative // @CriticalNative { "isHandlingTransaction", "()Z", (void*)android_os_Binder_isHandlingTransaction }, { "isDirectlyHandlingTransaction", "()Z", (void*)android_os_Binder_isDirectlyHandlingTransaction }, // @CriticalNative // @CriticalNative { "clearCallingIdentity", "()J", (void*)android_os_Binder_clearCallingIdentity }, { "clearCallingIdentity", "()J", (void*)android_os_Binder_clearCallingIdentity }, // @CriticalNative // @CriticalNative Loading @@ -1088,6 +1088,7 @@ static const JNINativeMethod gBinderMethods[] = { { "getExtension", "()Landroid/os/IBinder;", (void*)android_os_Binder_getExtension }, { "getExtension", "()Landroid/os/IBinder;", (void*)android_os_Binder_getExtension }, { "setExtension", "(Landroid/os/IBinder;)V", (void*)android_os_Binder_setExtension }, { "setExtension", "(Landroid/os/IBinder;)V", (void*)android_os_Binder_setExtension }, }; }; // clang-format on const char* const kBinderPathName = "android/os/Binder"; const char* const kBinderPathName = "android/os/Binder"; Loading Loading
core/java/android/os/Binder.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -313,7 +313,7 @@ public class Binder implements IBinder { * @hide * @hide */ */ @CriticalNative @CriticalNative public static final native boolean isHandlingTransaction(); public static final native boolean isDirectlyHandlingTransaction(); /** /** * Return the Linux uid assigned to the process that sent the transaction * Return the Linux uid assigned to the process that sent the transaction Loading @@ -323,7 +323,7 @@ public class Binder implements IBinder { * executing an incoming transaction. * executing an incoming transaction. */ */ public static final int getCallingUidOrThrow() { public static final int getCallingUidOrThrow() { if (!isHandlingTransaction()) { if (!isDirectlyHandlingTransaction()) { throw new IllegalStateException( throw new IllegalStateException( "Thread is not in a binder transcation"); "Thread is not in a binder transcation"); } } Loading
core/jni/android_util_Binder.cpp +4 −3 Original line number Original line Diff line number Diff line Loading @@ -959,8 +959,7 @@ static jint android_os_Binder_getCallingUid() return IPCThreadState::self()->getCallingUid(); return IPCThreadState::self()->getCallingUid(); } } static jboolean android_os_Binder_isHandlingTransaction() static jboolean android_os_Binder_isDirectlyHandlingTransaction() { { return getCurrentServingCall() == BinderCallType::BINDER; return getCurrentServingCall() == BinderCallType::BINDER; } } Loading Loading @@ -1056,6 +1055,7 @@ static void android_os_Binder_setExtension(JNIEnv* env, jobject obj, jobject ext // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // clang-format off static const JNINativeMethod gBinderMethods[] = { static const JNINativeMethod gBinderMethods[] = { /* name, signature, funcPtr */ /* name, signature, funcPtr */ // @CriticalNative // @CriticalNative Loading @@ -1063,7 +1063,7 @@ static const JNINativeMethod gBinderMethods[] = { // @CriticalNative // @CriticalNative { "getCallingUid", "()I", (void*)android_os_Binder_getCallingUid }, { "getCallingUid", "()I", (void*)android_os_Binder_getCallingUid }, // @CriticalNative // @CriticalNative { "isHandlingTransaction", "()Z", (void*)android_os_Binder_isHandlingTransaction }, { "isDirectlyHandlingTransaction", "()Z", (void*)android_os_Binder_isDirectlyHandlingTransaction }, // @CriticalNative // @CriticalNative { "clearCallingIdentity", "()J", (void*)android_os_Binder_clearCallingIdentity }, { "clearCallingIdentity", "()J", (void*)android_os_Binder_clearCallingIdentity }, // @CriticalNative // @CriticalNative Loading @@ -1088,6 +1088,7 @@ static const JNINativeMethod gBinderMethods[] = { { "getExtension", "()Landroid/os/IBinder;", (void*)android_os_Binder_getExtension }, { "getExtension", "()Landroid/os/IBinder;", (void*)android_os_Binder_getExtension }, { "setExtension", "(Landroid/os/IBinder;)V", (void*)android_os_Binder_setExtension }, { "setExtension", "(Landroid/os/IBinder;)V", (void*)android_os_Binder_setExtension }, }; }; // clang-format on const char* const kBinderPathName = "android/os/Binder"; const char* const kBinderPathName = "android/os/Binder"; Loading