summaryrefslogtreecommitdiff
path: root/usb/1.0/default/service.cpp
diff options
context:
space:
mode:
authorBadhri Jagan Sridharan <badhri@google.com>2017-04-05 21:16:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-04-05 21:16:05 +0000
commit33fd31e967a16fc9c998712869f2915d357aed47 (patch)
treebc1dafd8af024c4977bef301476e01e86377ec34 /usb/1.0/default/service.cpp
parent75e2bf046965f00b532ec789b58551da44c260ad (diff)
parent88a4d874151c8bd1a9058c99a42539a4f2990153 (diff)
Merge "USB: HIDL: check the status of registerAsService" into oc-dev
Diffstat (limited to 'usb/1.0/default/service.cpp')
-rw-r--r--usb/1.0/default/service.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/usb/1.0/default/service.cpp b/usb/1.0/default/service.cpp
index 4605a4c143..43ab6f0c49 100644
--- a/usb/1.0/default/service.cpp
+++ b/usb/1.0/default/service.cpp
@@ -27,13 +27,21 @@ using android::hardware::joinRpcThreadpool;
using android::hardware::usb::V1_0::IUsb;
using android::hardware::usb::V1_0::implementation::Usb;
+using android::status_t;
+using android::OK;
+
int main() {
android::sp<IUsb> service = new Usb();
configureRpcThreadpool(1, true /*callerWillJoin*/);
- service->registerAsService();
+ status_t status = service->registerAsService();
+
+ if (status == OK) {
+ ALOGI("USB HAL Ready.");
+ joinRpcThreadpool();
+ }
- ALOGI("USB HAL Ready.");
- joinRpcThreadpool();
+ ALOGE("Cannot register USB HAL service");
+ return 1;
}