From 0e5225250903835e7b8c83f2572908f1670be077 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 16 Mar 2017 16:09:31 -0700 Subject: [PATCH] IUsb uses "default" service name The getService() and registerAsService() methods of interface objects now have default parameters of "default" for the service name. HALs will not have to use any service name unless they want to register more than one service. Test: pass Bug: 33844934 Change-Id: Ic04a7570c090d9d0a83bac1ec3f6d5ffe19e8923 --- usb/1.0/default/service.cpp | 3 +-- usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/usb/1.0/default/service.cpp b/usb/1.0/default/service.cpp index b4db241447..4605a4c143 100644 --- a/usb/1.0/default/service.cpp +++ b/usb/1.0/default/service.cpp @@ -28,12 +28,11 @@ using android::hardware::usb::V1_0::IUsb; using android::hardware::usb::V1_0::implementation::Usb; int main() { - const char instance[] = "usb_hal"; android::sp service = new Usb(); configureRpcThreadpool(1, true /*callerWillJoin*/); - service->registerAsService(instance); + service->registerAsService(); ALOGI("USB HAL Ready."); joinRpcThreadpool(); diff --git a/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp b/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp index 54db8c2bf1..ea6d4a9ba9 100644 --- a/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp +++ b/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp @@ -47,8 +47,6 @@ using ::android::hardware::Return; using ::android::hardware::Void; using ::android::sp; -#define USB_SERVICE_NAME "usb_hal" - // The main test class for the USB hidl HAL class UsbHidlTest : public ::testing::VtsHalHidlTargetTestBase { public: @@ -97,7 +95,7 @@ class UsbHidlTest : public ::testing::VtsHalHidlTargetTestBase { virtual void SetUp() override { ALOGI("Setup"); - usb = ::testing::VtsHalHidlTargetTestBase::getService(USB_SERVICE_NAME); + usb = ::testing::VtsHalHidlTargetTestBase::getService(); ASSERT_NE(usb, nullptr); usb_cb_2 = new UsbCallback(*this, 2);