summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Martijn Coenen <maco@google.com> 2017-04-05 14:16:12 -0700
committer Martijn Coenen <maco@google.com> 2017-04-05 14:18:43 -0700
commitd6480caf4d58ff5060fa2fb20a3384bd2bcd38dc (patch)
tree8d0da2f04f9b8a6b5b7d051f86fdd898ebfdc6f4
parentc428826fdf6208da698fbdb1d49d0b51bfb924b6 (diff)
Add option to list vndservicemanager services.
Test: adb shell service list -v Bug: 36987120 Change-Id: I081a0c725ddb4175f4ab43714c25cc41ed2239a3
-rw-r--r--cmds/service/service.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/cmds/service/service.cpp b/cmds/service/service.cpp
index 428b87cd51..09921e45d3 100644
--- a/cmds/service/service.cpp
+++ b/cmds/service/service.cpp
@@ -68,18 +68,12 @@ static String8 good_old_string(const String16& src)
int main(int argc, char* const argv[])
{
- sp<IServiceManager> sm = defaultServiceManager();
- fflush(stdout);
- if (sm == NULL) {
- aerr << "service: Unable to get default service manager!" << endl;
- return 20;
- }
-
bool wantsUsage = false;
+ bool wantsVendorServices = false;
int result = 0;
while (1) {
- int ic = getopt(argc, argv, "h?");
+ int ic = getopt(argc, argv, "vh?");
if (ic < 0)
break;
@@ -88,6 +82,9 @@ int main(int argc, char* const argv[])
case '?':
wantsUsage = true;
break;
+ case 'v':
+ wantsVendorServices = true;
+ break;
default:
aerr << "service: Unknown option -" << ic << endl;
wantsUsage = true;
@@ -95,6 +92,16 @@ int main(int argc, char* const argv[])
break;
}
}
+
+ if (wantsVendorServices) {
+ ProcessState::initWithDriver("/dev/vndbinder");
+ }
+ sp<IServiceManager> sm = defaultServiceManager();
+ fflush(stdout);
+ if (sm == NULL) {
+ aerr << "service: Unable to get default service manager!" << endl;
+ return 20;
+ }
if (optind >= argc) {
wantsUsage = true;