Loading cmds/dumpstate/dumpstate.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -2084,7 +2084,7 @@ Dumpstate::RunStatus Dumpstate::DumpTraces(const char** path) { int timeout_failures = 0; int timeout_failures = 0; bool dalvik_found = false; bool dalvik_found = false; const std::set<int> hal_pids = get_interesting_hal_pids(); const std::set<int> hal_pids = get_interesting_pids(); struct dirent* d; struct dirent* d; while ((d = readdir(proc.get()))) { while ((d = readdir(proc.get()))) { Loading cmds/dumpsys/tests/dumpsys_test.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -65,6 +65,7 @@ class ServiceManagerMock : public IServiceManager { const sp<LocalRegistrationCallback>&)); const sp<LocalRegistrationCallback>&)); MOCK_METHOD2(unregisterForNotifications, status_t(const String16&, MOCK_METHOD2(unregisterForNotifications, status_t(const String16&, const sp<LocalRegistrationCallback>&)); const sp<LocalRegistrationCallback>&)); MOCK_METHOD0(getServiceDebugInfo, std::vector<ServiceDebugInfo>()); protected: protected: MOCK_METHOD0(onAsBinder, IBinder*()); MOCK_METHOD0(onAsBinder, IBinder*()); }; }; Loading libs/binder/IServiceManager.cpp +19 −0 Original line number Original line Diff line number Diff line Loading @@ -99,6 +99,8 @@ public: status_t unregisterForNotifications(const String16& service, status_t unregisterForNotifications(const String16& service, const sp<AidlRegistrationCallback>& cb) override; const sp<AidlRegistrationCallback>& cb) override; std::vector<IServiceManager::ServiceDebugInfo> getServiceDebugInfo() override; // for legacy ABI // for legacy ABI const String16& getInterfaceDescriptor() const override { const String16& getInterfaceDescriptor() const override { return mTheRealServiceManager->getInterfaceDescriptor(); return mTheRealServiceManager->getInterfaceDescriptor(); Loading Loading @@ -543,6 +545,23 @@ status_t ServiceManagerShim::unregisterForNotifications(const String16& name, return OK; 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__ #ifndef __ANDROID__ // ServiceManagerShim for host. Implements the old libbinder android::IServiceManager API. // ServiceManagerShim for host. Implements the old libbinder android::IServiceManager API. // The internal implementation of the AIDL interface android::os::IServiceManager calls into // The internal implementation of the AIDL interface android::os::IServiceManager calls into Loading libs/binder/include/binder/IServiceManager.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -134,6 +134,12 @@ public: virtual status_t unregisterForNotifications(const String16& name, virtual status_t unregisterForNotifications(const String16& name, const sp<LocalRegistrationCallback>& callback) = 0; const sp<LocalRegistrationCallback>& callback) = 0; struct ServiceDebugInfo { std::string name; int pid; }; virtual std::vector<ServiceDebugInfo> getServiceDebugInfo() = 0; }; }; sp<IServiceManager> defaultServiceManager(); sp<IServiceManager> defaultServiceManager(); Loading libs/dumputils/Android.bp +5 −1 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ cc_library { shared_libs: [ shared_libs: [ "libbase", "libbase", "libbinder", "libhidlbase", "libhidlbase", "liblog", "liblog", "libutils", "libutils", Loading @@ -33,7 +34,10 @@ cc_library { srcs: ["dump_utils.cpp"], srcs: ["dump_utils.cpp"], cflags: ["-Wall", "-Werror"], cflags: [ "-Wall", "-Werror", ], export_include_dirs: [ export_include_dirs: [ "include", "include", Loading Loading
cmds/dumpstate/dumpstate.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -2084,7 +2084,7 @@ Dumpstate::RunStatus Dumpstate::DumpTraces(const char** path) { int timeout_failures = 0; int timeout_failures = 0; bool dalvik_found = false; bool dalvik_found = false; const std::set<int> hal_pids = get_interesting_hal_pids(); const std::set<int> hal_pids = get_interesting_pids(); struct dirent* d; struct dirent* d; while ((d = readdir(proc.get()))) { while ((d = readdir(proc.get()))) { Loading
cmds/dumpsys/tests/dumpsys_test.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -65,6 +65,7 @@ class ServiceManagerMock : public IServiceManager { const sp<LocalRegistrationCallback>&)); const sp<LocalRegistrationCallback>&)); MOCK_METHOD2(unregisterForNotifications, status_t(const String16&, MOCK_METHOD2(unregisterForNotifications, status_t(const String16&, const sp<LocalRegistrationCallback>&)); const sp<LocalRegistrationCallback>&)); MOCK_METHOD0(getServiceDebugInfo, std::vector<ServiceDebugInfo>()); protected: protected: MOCK_METHOD0(onAsBinder, IBinder*()); MOCK_METHOD0(onAsBinder, IBinder*()); }; }; Loading
libs/binder/IServiceManager.cpp +19 −0 Original line number Original line Diff line number Diff line Loading @@ -99,6 +99,8 @@ public: status_t unregisterForNotifications(const String16& service, status_t unregisterForNotifications(const String16& service, const sp<AidlRegistrationCallback>& cb) override; const sp<AidlRegistrationCallback>& cb) override; std::vector<IServiceManager::ServiceDebugInfo> getServiceDebugInfo() override; // for legacy ABI // for legacy ABI const String16& getInterfaceDescriptor() const override { const String16& getInterfaceDescriptor() const override { return mTheRealServiceManager->getInterfaceDescriptor(); return mTheRealServiceManager->getInterfaceDescriptor(); Loading Loading @@ -543,6 +545,23 @@ status_t ServiceManagerShim::unregisterForNotifications(const String16& name, return OK; 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__ #ifndef __ANDROID__ // ServiceManagerShim for host. Implements the old libbinder android::IServiceManager API. // ServiceManagerShim for host. Implements the old libbinder android::IServiceManager API. // The internal implementation of the AIDL interface android::os::IServiceManager calls into // The internal implementation of the AIDL interface android::os::IServiceManager calls into Loading
libs/binder/include/binder/IServiceManager.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -134,6 +134,12 @@ public: virtual status_t unregisterForNotifications(const String16& name, virtual status_t unregisterForNotifications(const String16& name, const sp<LocalRegistrationCallback>& callback) = 0; const sp<LocalRegistrationCallback>& callback) = 0; struct ServiceDebugInfo { std::string name; int pid; }; virtual std::vector<ServiceDebugInfo> getServiceDebugInfo() = 0; }; }; sp<IServiceManager> defaultServiceManager(); sp<IServiceManager> defaultServiceManager(); Loading
libs/dumputils/Android.bp +5 −1 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ cc_library { shared_libs: [ shared_libs: [ "libbase", "libbase", "libbinder", "libhidlbase", "libhidlbase", "liblog", "liblog", "libutils", "libutils", Loading @@ -33,7 +34,10 @@ cc_library { srcs: ["dump_utils.cpp"], srcs: ["dump_utils.cpp"], cflags: ["-Wall", "-Werror"], cflags: [ "-Wall", "-Werror", ], export_include_dirs: [ export_include_dirs: [ "include", "include", Loading