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
This commit is contained in:
Chris Phoenix
2017-01-23 15:14:08 -08:00
committed by Yifan Hong
parent 4ba4bdcb70
commit ab5c1e192e
3 changed files with 6 additions and 6 deletions

View File

@@ -676,7 +676,7 @@ Return<sp<IGnssBatching>> 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<gps_device_t*>(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;
}

View File

@@ -8,5 +8,5 @@ using android::hardware::gnss::V1_0::IGnss;
using android::hardware::defaultPassthroughServiceImplementation;
int main() {
return defaultPassthroughServiceImplementation<IGnss>("gnss");
return defaultPassthroughServiceImplementation<IGnss>();
}

View File

@@ -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;
}
}