add dumpsys -l to list available services
- for people with poor memory like me :)
Change-Id: I60160ca333ac4864bb8328f164cc2e9eba3660fc
diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp
index 7cd5afd..ce8993d 100644
--- a/cmds/dumpsys/dumpsys.cpp
+++ b/cmds/dumpsys/dumpsys.cpp
@@ -39,7 +39,11 @@
Vector<String16> services;
Vector<String16> args;
- if (argc == 1) {
+ bool showListOnly = false;
+ if ((argc == 2) && (strcmp(argv[1], "-l") == 0)) {
+ showListOnly = true;
+ }
+ if ((argc == 1) || showListOnly) {
services = sm->listServices();
services.sort(sort_func);
args.add(String16("-a"));
@@ -64,6 +68,10 @@
}
}
+ if (showListOnly) {
+ return 0;
+ }
+
for (size_t i=0; i<N; i++) {
sp<IBinder> service = sm->checkService(services[i]);
if (service != NULL) {