Loading libs/binder/include/binder/IPCThreadState.h +7 −2 Original line number Diff line number Diff line Loading @@ -62,8 +62,13 @@ public: /** * Returns the PID of the process which has made the current binder * call. If not in a binder call, this will return getpid. If the * call is oneway, this will return 0. * call. If not in a binder call, this will return getpid. * * Warning: oneway transactions do not receive PID. Even if you expect * a transaction to be synchronous, a misbehaving client could send it * as an asynchronous call and result in a 0 PID here. Additionally, if * there is a race and the calling process dies, the PID may still be * 0 for a synchronous call. */ [[nodiscard]] pid_t getCallingPid() const; Loading libs/binder/ndk/include_ndk/android/binder_ibinder.h +6 −0 Original line number Diff line number Diff line Loading @@ -390,6 +390,12 @@ uid_t AIBinder_getCallingUid() __INTRODUCED_IN(29); * calling process dies and is replaced with another process with elevated permissions and the same * PID. * * Warning: oneway transactions do not receive PID. Even if you expect * a transaction to be synchronous, a misbehaving client could send it * as a synchronous call and result in a 0 PID here. Additionally, if * there is a race and the calling process dies, the PID may still be * 0 for a synchronous call. * * Available since API level 29. * * \return calling pid or the current process's PID if this thread isn't processing a transaction. Loading libs/binder/rust/src/state.rs +6 −3 Original line number Diff line number Diff line Loading @@ -101,13 +101,16 @@ impl ThreadState { /// dies and is replaced with another process with elevated permissions and /// the same PID. /// /// Warning: oneway transactions do not receive PID. Even if you expect /// a transaction to be synchronous, a misbehaving client could send it /// as a synchronous call and result in a 0 PID here. Additionally, if /// there is a race and the calling process dies, the PID may still be /// 0 for a synchronous call. /// /// Available since API level 29. /// /// \return calling pid or the current process's PID if this thread isn't /// processing a transaction. /// /// If the transaction being processed is a oneway transaction, then this /// method will return 0. pub fn get_calling_pid() -> pid_t { // Safety: Safe FFI unsafe { sys::AIBinder_getCallingPid() } Loading Loading
libs/binder/include/binder/IPCThreadState.h +7 −2 Original line number Diff line number Diff line Loading @@ -62,8 +62,13 @@ public: /** * Returns the PID of the process which has made the current binder * call. If not in a binder call, this will return getpid. If the * call is oneway, this will return 0. * call. If not in a binder call, this will return getpid. * * Warning: oneway transactions do not receive PID. Even if you expect * a transaction to be synchronous, a misbehaving client could send it * as an asynchronous call and result in a 0 PID here. Additionally, if * there is a race and the calling process dies, the PID may still be * 0 for a synchronous call. */ [[nodiscard]] pid_t getCallingPid() const; Loading
libs/binder/ndk/include_ndk/android/binder_ibinder.h +6 −0 Original line number Diff line number Diff line Loading @@ -390,6 +390,12 @@ uid_t AIBinder_getCallingUid() __INTRODUCED_IN(29); * calling process dies and is replaced with another process with elevated permissions and the same * PID. * * Warning: oneway transactions do not receive PID. Even if you expect * a transaction to be synchronous, a misbehaving client could send it * as a synchronous call and result in a 0 PID here. Additionally, if * there is a race and the calling process dies, the PID may still be * 0 for a synchronous call. * * Available since API level 29. * * \return calling pid or the current process's PID if this thread isn't processing a transaction. Loading
libs/binder/rust/src/state.rs +6 −3 Original line number Diff line number Diff line Loading @@ -101,13 +101,16 @@ impl ThreadState { /// dies and is replaced with another process with elevated permissions and /// the same PID. /// /// Warning: oneway transactions do not receive PID. Even if you expect /// a transaction to be synchronous, a misbehaving client could send it /// as a synchronous call and result in a 0 PID here. Additionally, if /// there is a race and the calling process dies, the PID may still be /// 0 for a synchronous call. /// /// Available since API level 29. /// /// \return calling pid or the current process's PID if this thread isn't /// processing a transaction. /// /// If the transaction being processed is a oneway transaction, then this /// method will return 0. pub fn get_calling_pid() -> pid_t { // Safety: Safe FFI unsafe { sys::AIBinder_getCallingPid() } Loading