diff options
author | 2017-04-07 10:46:57 -0700 | |
---|---|---|
committer | 2017-04-07 10:46:57 -0700 | |
commit | 3def1f2d8212d44527f5de0c22874326239a0a13 (patch) | |
tree | fb9e660f3ff75e9ceb1530c12c61f1ac662ba4a7 | |
parent | 3e7dad572220e2c4b9bfbd471a6278385e99330d (diff) |
Add separate 'vndservice' binary.
This is installed on the vendor partition,
and can be used to call into vndservicemanager
and the services it hosts.
Bug: 36987120
Test: vndservice list works
Change-Id: I2d72312276cd4402ee1b399713cd5322b125b00f
-rw-r--r-- | cmds/service/Android.bp | 15 | ||||
-rw-r--r-- | cmds/service/service.cpp | 13 |
2 files changed, 18 insertions, 10 deletions
diff --git a/cmds/service/Android.bp b/cmds/service/Android.bp index 8cffb3c701..b703ed4c4c 100644 --- a/cmds/service/Android.bp +++ b/cmds/service/Android.bp @@ -9,5 +9,18 @@ cc_binary { ], cflags: ["-DXP_UNIX"], - //shared_libs: ["librt"], +} + +cc_binary { + name: "vndservice", + + proprietary: true, + srcs: ["service.cpp"], + + shared_libs: [ + "libutils", + "libbinder", + ], + + cflags: ["-DXP_UNIX", "-DVENDORSERVICES"], } diff --git a/cmds/service/service.cpp b/cmds/service/service.cpp index 09921e45d3..bc11256a73 100644 --- a/cmds/service/service.cpp +++ b/cmds/service/service.cpp @@ -69,11 +69,10 @@ static String8 good_old_string(const String16& src) int main(int argc, char* const argv[]) { bool wantsUsage = false; - bool wantsVendorServices = false; int result = 0; while (1) { - int ic = getopt(argc, argv, "vh?"); + int ic = getopt(argc, argv, "h?"); if (ic < 0) break; @@ -82,9 +81,6 @@ 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; @@ -92,10 +88,9 @@ int main(int argc, char* const argv[]) break; } } - - if (wantsVendorServices) { - ProcessState::initWithDriver("/dev/vndbinder"); - } +#ifdef VENDORSERVICES + ProcessState::initWithDriver("/dev/vndbinder"); +#endif sp<IServiceManager> sm = defaultServiceManager(); fflush(stdout); if (sm == NULL) { |