diff options
Diffstat (limited to 'usb/service.cpp')
| -rw-r--r-- | usb/service.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/usb/service.cpp b/usb/service.cpp index b0f1ce00..37efef1f 100644 --- a/usb/service.cpp +++ b/usb/service.cpp @@ -17,7 +17,6 @@ #include <hidl/HidlTransportSupport.h> #include "Usb.h" -#include "UsbGadget.h" using android::sp; @@ -27,36 +26,23 @@ using android::hardware::joinRpcThreadpool; // Generated HIDL files using android::hardware::usb::V1_1::IUsb; -using android::hardware::usb::gadget::V1_0::IUsbGadget; using android::hardware::usb::V1_1::implementation::Usb; -using android::hardware::usb::gadget::V1_0::implementation::UsbGadget; -using android::OK; using android::status_t; +using android::OK; int main() { android::sp<IUsb> service = new Usb(); - android::sp<IUsbGadget> service2 = new UsbGadget(); - configureRpcThreadpool(2, true /*callerWillJoin*/); + configureRpcThreadpool(1, true /*callerWillJoin*/); status_t status = service->registerAsService(); - if (status != OK) { - ALOGE("Cannot register USB HAL service"); - return 1; - } - - status = service2->registerAsService(); - - if (status != OK) { - ALOGE("Cannot register USB Gadget HAL service"); - return 1; + if (status == OK) { + ALOGI("USB HAL Ready."); + joinRpcThreadpool(); } - ALOGI("USB HAL Ready."); - joinRpcThreadpool(); - // Under noraml cases, execution will not reach this line. - ALOGI("USB HAL failed to join thread pool."); + ALOGE("Cannot register USB HAL service"); return 1; } |
