Merge "Rename isHandlingTransaction to isDirectlyHandlingTransaction" am: 7eb7f9efaf am: 0a3a353ec0 am: 84dc08e004 am: 1f4f565bf0 am: 0b0587fd69
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1818907 Change-Id: Ib60f38d89255e3c8503ddc4e1dfdac187ecad87c
This commit is contained in:
@@ -313,7 +313,7 @@ public class Binder implements IBinder {
|
||||
* @hide
|
||||
*/
|
||||
@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
|
||||
@@ -323,7 +323,7 @@ public class Binder implements IBinder {
|
||||
* executing an incoming transaction.
|
||||
*/
|
||||
public static final int getCallingUidOrThrow() {
|
||||
if (!isHandlingTransaction()) {
|
||||
if (!isDirectlyHandlingTransaction()) {
|
||||
throw new IllegalStateException(
|
||||
"Thread is not in a binder transcation");
|
||||
}
|
||||
|
||||
@@ -959,8 +959,7 @@ static jint android_os_Binder_getCallingUid()
|
||||
return IPCThreadState::self()->getCallingUid();
|
||||
}
|
||||
|
||||
static jboolean android_os_Binder_isHandlingTransaction()
|
||||
{
|
||||
static jboolean android_os_Binder_isDirectlyHandlingTransaction() {
|
||||
return getCurrentServingCall() == BinderCallType::BINDER;
|
||||
}
|
||||
|
||||
@@ -1056,6 +1055,7 @@ static void android_os_Binder_setExtension(JNIEnv* env, jobject obj, jobject ext
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// clang-format off
|
||||
static const JNINativeMethod gBinderMethods[] = {
|
||||
/* name, signature, funcPtr */
|
||||
// @CriticalNative
|
||||
@@ -1063,7 +1063,7 @@ static const JNINativeMethod gBinderMethods[] = {
|
||||
// @CriticalNative
|
||||
{ "getCallingUid", "()I", (void*)android_os_Binder_getCallingUid },
|
||||
// @CriticalNative
|
||||
{ "isHandlingTransaction", "()Z", (void*)android_os_Binder_isHandlingTransaction },
|
||||
{ "isDirectlyHandlingTransaction", "()Z", (void*)android_os_Binder_isDirectlyHandlingTransaction },
|
||||
// @CriticalNative
|
||||
{ "clearCallingIdentity", "()J", (void*)android_os_Binder_clearCallingIdentity },
|
||||
// @CriticalNative
|
||||
@@ -1088,6 +1088,7 @@ static const JNINativeMethod gBinderMethods[] = {
|
||||
{ "getExtension", "()Landroid/os/IBinder;", (void*)android_os_Binder_getExtension },
|
||||
{ "setExtension", "(Landroid/os/IBinder;)V", (void*)android_os_Binder_setExtension },
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
const char* const kBinderPathName = "android/os/Binder";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user