diff options
Diffstat (limited to 'include/kdbinder/binder/ProcessState.h')
-rw-r--r-- | include/kdbinder/binder/ProcessState.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/kdbinder/binder/ProcessState.h b/include/kdbinder/binder/ProcessState.h index 0e5893d..97c831b 100644 --- a/include/kdbinder/binder/ProcessState.h +++ b/include/kdbinder/binder/ProcessState.h @@ -46,6 +46,7 @@ class ProcessState : public virtual RefBase { friend class IPCThreadState; // BpServiceManager needs to call registerService. friend class BpServiceManager; + friend class Parcel; ProcessState(); ~ProcessState() = default; @@ -59,6 +60,22 @@ class ProcessState : public virtual RefBase { // Add the given Binder object in mServiceTable. int32_t registerService(sp<IBinder> binder, String16 name); + int32_t registerBinder(sp<IBinder> binder); + + // Get the handle of a given Binder. + // - If the Binder is local: + // Search it in mServiceTable and return the handle. If it + // does not find it, it will add it to the table and return the new + // handle. + // - If the Binder is remote: + // Simply lookup its handle and return it. + int32_t getHandleForBinder(sp<IBinder> binder); + + // Get the Binder object with the given handle. + // This method will search mServiceTable and return the local Binder + // that it found. If it did not find it, then it will create a new + // remove Binder. + sp<IBinder> getBinderForHandle(int32_t handle); // Each Binder object managed by ProcessState need a kdbus::Connection // associated with them. |