From ab5c1e192e72e153afe7f08ffb46f0a86ee4e9cb Mon Sep 17 00:00:00 2001 From: Chris Phoenix Date: Mon, 23 Jan 2017 15:14:08 -0800 Subject: [PATCH] gnss 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 Bug: 33844934 Change-Id: I0c0cafff5079e49edbfd1f4858760f0c53d3fcfa --- gnss/1.0/default/Gnss.cpp | 6 +++--- gnss/1.0/default/service.cpp | 2 +- gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gnss/1.0/default/Gnss.cpp b/gnss/1.0/default/Gnss.cpp index 10024fbeaf..9493737545 100644 --- a/gnss/1.0/default/Gnss.cpp +++ b/gnss/1.0/default/Gnss.cpp @@ -676,7 +676,7 @@ Return> Gnss::getExtensionGnssBatching() { return mGnssBatching; } -IGnss* HIDL_FETCH_IGnss(const char* hal) { +IGnss* HIDL_FETCH_IGnss(const char* /* hal */) { hw_module_t* module; IGnss* iface = nullptr; int err = hw_get_module(GPS_HARDWARE_MODULE_ID, (hw_module_t const**)&module); @@ -687,10 +687,10 @@ IGnss* HIDL_FETCH_IGnss(const char* hal) { if (err == 0) { iface = new Gnss(reinterpret_cast(device)); } else { - ALOGE("gnssDevice open %s failed: %d", hal, err); + ALOGE("gnssDevice open %s failed: %d", GPS_HARDWARE_MODULE_ID, err); } } else { - ALOGE("gnss hw_get_module %s failed: %d", hal, err); + ALOGE("gnss hw_get_module %s failed: %d", GPS_HARDWARE_MODULE_ID, err); } return iface; } diff --git a/gnss/1.0/default/service.cpp b/gnss/1.0/default/service.cpp index 4e040c5945..5a8acc106f 100644 --- a/gnss/1.0/default/service.cpp +++ b/gnss/1.0/default/service.cpp @@ -8,5 +8,5 @@ using android::hardware::gnss::V1_0::IGnss; using android::hardware::defaultPassthroughServiceImplementation; int main() { - return defaultPassthroughServiceImplementation("gnss"); + return defaultPassthroughServiceImplementation(); } diff --git a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp index f1cd9ec1f6..3a9de9a0a8 100644 --- a/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp +++ b/gnss/1.0/vts/functional/VtsHalGnssV1_0TargetTest.cpp @@ -45,7 +45,7 @@ class GnssHalTest : public ::testing::Test { * callbacks trigger. */ - gnss_hal_ = IGnss::getService("gnss"); + gnss_hal_ = IGnss::getService(); ASSERT_NE(gnss_hal_, nullptr); gnss_cb_ = new GnssCallback(*this); @@ -276,4 +276,4 @@ int main(int argc, char** argv) { int status = RUN_ALL_TESTS(); ALOGI("Test result = %d", status); return status; -} \ No newline at end of file +}