summaryrefslogtreecommitdiff
path: root/libs/binder/IServiceManager.cpp
diff options
context:
space:
mode:
author Jayant Chowdhary <jchowdhary@google.com> 2022-05-20 03:30:09 +0000
committer Jayant Chowdhary <jchowdhary@google.com> 2022-06-16 17:50:42 +0000
commita0a8eb20f206a7a139bd0c0a5111dcb269c520db (patch)
tree7d560e2bb90a7dc62f43096744142a3b95864be9 /libs/binder/IServiceManager.cpp
parent2fd11cca9c4eef0d71647e882835b2ee42a63b7b (diff)
Add AIDL HAL stack traces to bug-reports
Bug: 233130219 Test: adb bugreport; check that camera provider has stack traces in VM traces Ignore-AOSP-First: I will cherry-pick after the topic is submitted. Merged-In: I1e087600ac764191a91eb9b1f11e51f21bce19e3 Change-Id: I1e087600ac764191a91eb9b1f11e51f21bce19e3 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com> (cherry picked from commit ddd3da0d8f092a24d2a8a9a1e211d60292b7da35)
Diffstat (limited to 'libs/binder/IServiceManager.cpp')
-rw-r--r--libs/binder/IServiceManager.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
index ea2f8d2274..fd2d86857e 100644
--- a/libs/binder/IServiceManager.cpp
+++ b/libs/binder/IServiceManager.cpp
@@ -99,6 +99,8 @@ public:
status_t unregisterForNotifications(const String16& service,
const sp<AidlRegistrationCallback>& cb) override;
+
+ std::vector<IServiceManager::ServiceDebugInfo> getServiceDebugInfo() override;
// for legacy ABI
const String16& getInterfaceDescriptor() const override {
return mTheRealServiceManager->getInterfaceDescriptor();
@@ -543,6 +545,23 @@ status_t ServiceManagerShim::unregisterForNotifications(const String16& name,
return OK;
}
+std::vector<IServiceManager::ServiceDebugInfo> ServiceManagerShim::getServiceDebugInfo() {
+ std::vector<os::ServiceDebugInfo> serviceDebugInfos;
+ std::vector<IServiceManager::ServiceDebugInfo> ret;
+ if (Status status = mTheRealServiceManager->getServiceDebugInfo(&serviceDebugInfos);
+ !status.isOk()) {
+ ALOGW("%s Failed to get ServiceDebugInfo", __FUNCTION__);
+ return ret;
+ }
+ for (const auto& serviceDebugInfo : serviceDebugInfos) {
+ IServiceManager::ServiceDebugInfo retInfo;
+ retInfo.pid = serviceDebugInfo.debugPid;
+ retInfo.name = serviceDebugInfo.name;
+ ret.emplace_back(retInfo);
+ }
+ return ret;
+}
+
#ifndef __ANDROID__
// ServiceManagerShim for host. Implements the old libbinder android::IServiceManager API.
// The internal implementation of the AIDL interface android::os::IServiceManager calls into