summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Devin Moore <devinmoore@google.com> 2021-08-05 19:03:47 +0000
committer Devin Moore <devinmoore@google.com> 2021-08-05 19:03:47 +0000
commitf6f2e64c29af2200e89fdf39ccc23d2bb57cce07 (patch)
treee0975f7c2e7a6f95ecfb10b3611ccd95cef56726
parent5bff74281079ff595935bf95793999f2fa3a0d86 (diff)
Add API to BpBinder to get handle for debugging
This is the local handle for the process requesting it. Test: build Change-Id: I87df46d166bf5041972624af42369a76adb52ee9
-rw-r--r--libs/binder/BpBinder.cpp8
-rw-r--r--libs/binder/include/binder/BpBinder.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp
index 765e21cb38..55566e2db9 100644
--- a/libs/binder/BpBinder.cpp
+++ b/libs/binder/BpBinder.cpp
@@ -188,6 +188,14 @@ int32_t BpBinder::binderHandle() const {
return std::get<BinderHandle>(mHandle).handle;
}
+std::optional<int32_t> BpBinder::getDebugBinderHandle() const {
+ if (!isRpcBinder()) {
+ return binderHandle();
+ } else {
+ return std::nullopt;
+ }
+}
+
bool BpBinder::isDescriptorCached() const {
Mutex::Autolock _l(mLock);
return mDescriptorCache.size() ? true : false;
diff --git a/libs/binder/include/binder/BpBinder.h b/libs/binder/include/binder/BpBinder.h
index c69bb9e744..a6d35c7481 100644
--- a/libs/binder/include/binder/BpBinder.h
+++ b/libs/binder/include/binder/BpBinder.h
@@ -90,6 +90,8 @@ public:
static void setLimitCallback(binder_proxy_limit_callback cb);
static void setBinderProxyCountWatermarks(int high, int low);
+ std::optional<int32_t> getDebugBinderHandle() const;
+
class ObjectManager {
public:
ObjectManager();