* limitations under the License.
*/
+#define LOG_TAG "android.hardware.usb@1.1-service.exynos9610"
+
#include <hidl/HidlTransportSupport.h>
#include "Usb.h"
using android::hardware::joinRpcThreadpool;
// Generated HIDL files
-using android::hardware::usb::V1_0::IUsb;
-using android::hardware::usb::V1_0::implementation::Usb;
+using android::hardware::usb::V1_1::IUsb;
+using android::hardware::usb::V1_1::implementation::Usb;
-int main() {
- const char instance[] = "usb_hal";
+using android::status_t;
+using android::OK;
+int main() {
android::sp<IUsb> service = new Usb();
configureRpcThreadpool(1, true /*callerWillJoin*/);
- service->registerAsService(instance);
+ status_t status = service->registerAsService();
+
+ if (status != OK) {
+ ALOGE("Cannot register USB HAL service");
+ return 1;
+ }
ALOGI("USB HAL Ready.");
joinRpcThreadpool();
+ // Under noraml cases, execution will not reach this line.
+ ALOGI("USB HAL failed to join thread pool.");
+ return 1;
+
}