Loading core/java/android/os/Binder.java +5 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,7 @@ public class Binder implements IBinder { * If the current thread is not currently executing an incoming transaction, * then its own pid is returned. */ @CriticalNative public static final native int getCallingPid(); /** Loading @@ -258,6 +259,7 @@ public class Binder implements IBinder { * permissions. If the current thread is not currently executing an * incoming transaction, then its own uid is returned. */ @CriticalNative public static final native int getCallingUid(); /** Loading Loading @@ -288,6 +290,7 @@ public class Binder implements IBinder { * @see #getCallingUid() * @see #restoreCallingIdentity(long) */ @CriticalNative public static final native long clearCallingIdentity(); /** Loading Loading @@ -364,6 +367,7 @@ public class Binder implements IBinder { * @see StrictMode * @hide */ @CriticalNative public static final native void setThreadStrictModePolicy(int policyMask); /** Loading @@ -372,6 +376,7 @@ public class Binder implements IBinder { * @see #setThreadStrictModePolicy * @hide */ @CriticalNative public static final native int getThreadStrictModePolicy(); /** Loading core/jni/android_util_Binder.cpp +10 −5 Original line number Diff line number Diff line Loading @@ -865,17 +865,17 @@ void signalExceptionForError(JNIEnv* env, jobject obj, status_t err, // ---------------------------------------------------------------------------- static jint android_os_Binder_getCallingPid(JNIEnv* env, jobject clazz) static jint android_os_Binder_getCallingPid() { return IPCThreadState::self()->getCallingPid(); } static jint android_os_Binder_getCallingUid(JNIEnv* env, jobject clazz) static jint android_os_Binder_getCallingUid() { return IPCThreadState::self()->getCallingUid(); } static jlong android_os_Binder_clearCallingIdentity(JNIEnv* env, jobject clazz) static jlong android_os_Binder_clearCallingIdentity() { return IPCThreadState::self()->clearCallingIdentity(); } Loading @@ -894,12 +894,12 @@ static void android_os_Binder_restoreCallingIdentity(JNIEnv* env, jobject clazz, IPCThreadState::self()->restoreCallingIdentity(token); } static void android_os_Binder_setThreadStrictModePolicy(JNIEnv* env, jobject clazz, jint policyMask) static void android_os_Binder_setThreadStrictModePolicy(jint policyMask) { IPCThreadState::self()->setStrictModePolicy(policyMask); } static jint android_os_Binder_getThreadStrictModePolicy(JNIEnv* env, jobject clazz) static jint android_os_Binder_getThreadStrictModePolicy() { return IPCThreadState::self()->getStrictModePolicy(); } Loading Loading @@ -950,11 +950,16 @@ static void android_os_Binder_blockUntilThreadAvailable(JNIEnv* env, jobject cla static const JNINativeMethod gBinderMethods[] = { /* name, signature, funcPtr */ // @CriticalNative { "getCallingPid", "()I", (void*)android_os_Binder_getCallingPid }, // @CriticalNative { "getCallingUid", "()I", (void*)android_os_Binder_getCallingUid }, // @CriticalNative { "clearCallingIdentity", "()J", (void*)android_os_Binder_clearCallingIdentity }, { "restoreCallingIdentity", "(J)V", (void*)android_os_Binder_restoreCallingIdentity }, // @CriticalNative { "setThreadStrictModePolicy", "(I)V", (void*)android_os_Binder_setThreadStrictModePolicy }, // @CriticalNative { "getThreadStrictModePolicy", "()I", (void*)android_os_Binder_getThreadStrictModePolicy }, // @CriticalNative { "setThreadWorkSource", "(I)I", (void*)android_os_Binder_setThreadWorkSource }, Loading Loading
core/java/android/os/Binder.java +5 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,7 @@ public class Binder implements IBinder { * If the current thread is not currently executing an incoming transaction, * then its own pid is returned. */ @CriticalNative public static final native int getCallingPid(); /** Loading @@ -258,6 +259,7 @@ public class Binder implements IBinder { * permissions. If the current thread is not currently executing an * incoming transaction, then its own uid is returned. */ @CriticalNative public static final native int getCallingUid(); /** Loading Loading @@ -288,6 +290,7 @@ public class Binder implements IBinder { * @see #getCallingUid() * @see #restoreCallingIdentity(long) */ @CriticalNative public static final native long clearCallingIdentity(); /** Loading Loading @@ -364,6 +367,7 @@ public class Binder implements IBinder { * @see StrictMode * @hide */ @CriticalNative public static final native void setThreadStrictModePolicy(int policyMask); /** Loading @@ -372,6 +376,7 @@ public class Binder implements IBinder { * @see #setThreadStrictModePolicy * @hide */ @CriticalNative public static final native int getThreadStrictModePolicy(); /** Loading
core/jni/android_util_Binder.cpp +10 −5 Original line number Diff line number Diff line Loading @@ -865,17 +865,17 @@ void signalExceptionForError(JNIEnv* env, jobject obj, status_t err, // ---------------------------------------------------------------------------- static jint android_os_Binder_getCallingPid(JNIEnv* env, jobject clazz) static jint android_os_Binder_getCallingPid() { return IPCThreadState::self()->getCallingPid(); } static jint android_os_Binder_getCallingUid(JNIEnv* env, jobject clazz) static jint android_os_Binder_getCallingUid() { return IPCThreadState::self()->getCallingUid(); } static jlong android_os_Binder_clearCallingIdentity(JNIEnv* env, jobject clazz) static jlong android_os_Binder_clearCallingIdentity() { return IPCThreadState::self()->clearCallingIdentity(); } Loading @@ -894,12 +894,12 @@ static void android_os_Binder_restoreCallingIdentity(JNIEnv* env, jobject clazz, IPCThreadState::self()->restoreCallingIdentity(token); } static void android_os_Binder_setThreadStrictModePolicy(JNIEnv* env, jobject clazz, jint policyMask) static void android_os_Binder_setThreadStrictModePolicy(jint policyMask) { IPCThreadState::self()->setStrictModePolicy(policyMask); } static jint android_os_Binder_getThreadStrictModePolicy(JNIEnv* env, jobject clazz) static jint android_os_Binder_getThreadStrictModePolicy() { return IPCThreadState::self()->getStrictModePolicy(); } Loading Loading @@ -950,11 +950,16 @@ static void android_os_Binder_blockUntilThreadAvailable(JNIEnv* env, jobject cla static const JNINativeMethod gBinderMethods[] = { /* name, signature, funcPtr */ // @CriticalNative { "getCallingPid", "()I", (void*)android_os_Binder_getCallingPid }, // @CriticalNative { "getCallingUid", "()I", (void*)android_os_Binder_getCallingUid }, // @CriticalNative { "clearCallingIdentity", "()J", (void*)android_os_Binder_clearCallingIdentity }, { "restoreCallingIdentity", "(J)V", (void*)android_os_Binder_restoreCallingIdentity }, // @CriticalNative { "setThreadStrictModePolicy", "(I)V", (void*)android_os_Binder_setThreadStrictModePolicy }, // @CriticalNative { "getThreadStrictModePolicy", "()I", (void*)android_os_Binder_getThreadStrictModePolicy }, // @CriticalNative { "setThreadWorkSource", "(I)I", (void*)android_os_Binder_setThreadWorkSource }, Loading