Loading libs/binder/ndk/ibinder.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -555,6 +555,10 @@ pid_t AIBinder_getCallingPid() { return ::android::IPCThreadState::self()->getCallingPid(); } bool AIBinder_isHandlingTransaction() { return ::android::IPCThreadState::self()->getServingStackPointer() != nullptr; } void AIBinder_incStrong(AIBinder* binder) { if (binder == nullptr) { return; Loading libs/binder/ndk/include_ndk/android/binder_ibinder.h +8 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,14 @@ uid_t AIBinder_getCallingUid() __INTRODUCED_IN(29); */ pid_t AIBinder_getCallingPid() __INTRODUCED_IN(29); /** * Determine whether the current thread is currently executing an incoming transaction. * * \return true if the current thread is currently executing an incoming transaction, and false * otherwise. */ bool AIBinder_isHandlingTransaction() __INTRODUCED_IN(33); /** * This can only be called if a strong reference to this object already exists in process. * Loading libs/binder/ndk/libbinder_ndk.map.txt +1 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ LIBBINDER_NDK33 { # introduced=33 global: AIBinder_Class_disableInterfaceTokenHeader; AIBinder_DeathRecipient_setOnUnlinked; AIBinder_isHandlingTransaction; AIBinder_setMinSchedulerPolicy; # llndk AParcel_marshal; AParcel_unmarshal; Loading libs/binder/rust/src/state.rs +11 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,17 @@ impl ThreadState { } } /// Determine whether the current thread is currently executing an incoming transaction. /// /// \return true if the current thread is currently executing an incoming transaction, and false /// otherwise. pub fn is_handling_transaction() -> bool { unsafe { // Safety: Safe FFI sys::AIBinder_isHandlingTransaction() } } /// This function makes the client's security context available to the /// service calling this function. This can be used for access control. /// It does not suffer from the TOCTOU issues of get_calling_pid. Loading Loading
libs/binder/ndk/ibinder.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -555,6 +555,10 @@ pid_t AIBinder_getCallingPid() { return ::android::IPCThreadState::self()->getCallingPid(); } bool AIBinder_isHandlingTransaction() { return ::android::IPCThreadState::self()->getServingStackPointer() != nullptr; } void AIBinder_incStrong(AIBinder* binder) { if (binder == nullptr) { return; Loading
libs/binder/ndk/include_ndk/android/binder_ibinder.h +8 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,14 @@ uid_t AIBinder_getCallingUid() __INTRODUCED_IN(29); */ pid_t AIBinder_getCallingPid() __INTRODUCED_IN(29); /** * Determine whether the current thread is currently executing an incoming transaction. * * \return true if the current thread is currently executing an incoming transaction, and false * otherwise. */ bool AIBinder_isHandlingTransaction() __INTRODUCED_IN(33); /** * This can only be called if a strong reference to this object already exists in process. * Loading
libs/binder/ndk/libbinder_ndk.map.txt +1 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ LIBBINDER_NDK33 { # introduced=33 global: AIBinder_Class_disableInterfaceTokenHeader; AIBinder_DeathRecipient_setOnUnlinked; AIBinder_isHandlingTransaction; AIBinder_setMinSchedulerPolicy; # llndk AParcel_marshal; AParcel_unmarshal; Loading
libs/binder/rust/src/state.rs +11 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,17 @@ impl ThreadState { } } /// Determine whether the current thread is currently executing an incoming transaction. /// /// \return true if the current thread is currently executing an incoming transaction, and false /// otherwise. pub fn is_handling_transaction() -> bool { unsafe { // Safety: Safe FFI sys::AIBinder_isHandlingTransaction() } } /// This function makes the client's security context available to the /// service calling this function. This can be used for access control. /// It does not suffer from the TOCTOU issues of get_calling_pid. Loading