From 3b06b22ed40a3b85d52bc79ee9d4ba88487eaca9 Mon Sep 17 00:00:00 2001 From: Chris Phoenix Date: Wed, 18 Jan 2017 15:51:05 -0800 Subject: [PATCH] Nfc HAL 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: builds; verify HAL still works In support of b/33844934 Change-Id: Id7b76e1df98e1ecacb530a1b5fec76bf14ba6eb7 --- nfc/1.0/default/Nfc.cpp | 2 +- nfc/1.0/default/service.cpp | 2 +- nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp | 4 +--- .../vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/nfc/1.0/default/Nfc.cpp b/nfc/1.0/default/Nfc.cpp index 9d05fc2791..3bd5e41876 100644 --- a/nfc/1.0/default/Nfc.cpp +++ b/nfc/1.0/default/Nfc.cpp @@ -65,7 +65,7 @@ INfc* HIDL_FETCH_INfc(const char * /*name*/) { } } else - ALOGE ("hw_get_module failed: %d", ret); + ALOGE ("hw_get_module %s failed: %d", NFC_NCI_HARDWARE_MODULE_ID, ret); if (ret == 0) { return new Nfc(nfc_device); diff --git a/nfc/1.0/default/service.cpp b/nfc/1.0/default/service.cpp index 32f9c286bb..731acd5aa2 100644 --- a/nfc/1.0/default/service.cpp +++ b/nfc/1.0/default/service.cpp @@ -9,5 +9,5 @@ using android::hardware::nfc::V1_0::INfc; using android::hardware::defaultPassthroughServiceImplementation; int main() { - return defaultPassthroughServiceImplementation("nfc_nci"); + return defaultPassthroughServiceImplementation(); } diff --git a/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp b/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp index f5ed4d7594..521f17f247 100644 --- a/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp +++ b/nfc/1.0/vts/functional/nfc_hidl_hal_test.cpp @@ -37,8 +37,6 @@ using ::android::hardware::Void; using ::android::hardware::hidl_vec; using ::android::sp; -#define NFC_NCI_SERVICE_NAME "nfc_nci" - /* NCI Commands */ #define CORE_RESET_CMD \ { 0x20, 0x00, 0x01, 0x00 } @@ -61,7 +59,7 @@ static bool passthrough = true; class NfcHidlTest : public ::testing::Test { public: virtual void SetUp() override { - nfc_ = INfc::getService(NFC_NCI_SERVICE_NAME, passthrough); + nfc_ = INfc::getService(passthrough); ASSERT_NE(nfc_, nullptr); nfc_cb_ = new NfcClientCallback(*this); diff --git a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py index f2f17f4c67..cb4093137b 100644 --- a/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py +++ b/nfc/1.0/vts/functional/vts/testcases/hal/nfc/hidl/host/NfcHidlBasicTest.py @@ -54,7 +54,6 @@ class NfcHidlBasicTest(base_test_with_webdb.BaseTestWithWebDbClass): target_version=1.0, target_package="android.hardware.nfc", target_component_name="INfc", - hw_binder_service_name="nfc_nci", bits=64 if self.dut.is64Bit else 32) def tearDownClass(self):