dumpsys: add option to list hardware services.
This gives a convenient way to dump information about hidl services.
When hidl services dump information themselves as well, that dump will
be made here as well.
Bug: 33382892
Test: dumpsys_test, dumpsys --hw works as expected
Change-Id: Ib08b5d052e63ed6260035ee8d3ad3dac296202b1
diff --git a/cmds/dumpsys/main.cpp b/cmds/dumpsys/main.cpp
index 8ba0eba..b180c98 100644
--- a/cmds/dumpsys/main.cpp
+++ b/cmds/dumpsys/main.cpp
@@ -27,6 +27,7 @@
#include <stdio.h>
using namespace android;
+using HServiceManager = android::hidl::manager::V1_0::IServiceManager;
int main(int argc, char* const argv[]) {
signal(SIGPIPE, SIG_IGN);
@@ -38,6 +39,8 @@
return 20;
}
- Dumpsys dumpsys(sm.get());
+ sp<HServiceManager> hm = HServiceManager::getService("manager");
+
+ Dumpsys dumpsys(sm.get(), hm.get());
return dumpsys.main(argc, argv);
}