diff options
author | Steven Moreland <smoreland@google.com> | 2017-03-29 20:59:06 -0700 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2017-03-29 20:59:06 -0700 |
commit | 6116af82fb47cb3471bc1e37e86371b3a9d245e5 (patch) | |
tree | 5dc80ea0a0419507a565843aa61e868672fa54a6 /dumpstate | |
parent | 748de16ab3ecdc1b5569cabedc5715dd17f7959c (diff) | |
download | bullhead-6116af82fb47cb3471bc1e37e86371b3a9d245e5.tar.gz |
Check result of registerAsService in dumpstate.
Test: see change I35f5d4498abd7369b03a04081e8aa26a3933328e
Bug: 36704363
Change-Id: I202d63e9c0d5d6504284ca4b1692e71c43befea4
Diffstat (limited to 'dumpstate')
-rw-r--r-- | dumpstate/service.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/dumpstate/service.cpp b/dumpstate/service.cpp index ba5288f..9500457 100644 --- a/dumpstate/service.cpp +++ b/dumpstate/service.cpp @@ -24,12 +24,18 @@ using ::android::hardware::configureRpcThreadpool; using ::android::hardware::dumpstate::V1_0::IDumpstateDevice; using ::android::hardware::dumpstate::V1_0::implementation::DumpstateDevice; using ::android::hardware::joinRpcThreadpool; +using ::android::OK; using ::android::sp; - int main(int /* argc */, char* /* argv */ []) { - sp<IDumpstateDevice> dumpstate = new DumpstateDevice; - configureRpcThreadpool(1, true); - dumpstate->registerAsService(); - joinRpcThreadpool(); + sp<IDumpstateDevice> dumpstate = new DumpstateDevice; + configureRpcThreadpool(1, true /* will join */); + if (dumpstate->registerAsService() != OK) { + ALOGE("Could not register service."); + return 1; + } + joinRpcThreadpool(); + + ALOGE("Service exited!"); + return 1; } |