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
diff --git a/gnss/1.0/default/Gnss.cpp b/gnss/1.0/default/Gnss.cpp
index 10024fb..9493737 100644
--- a/gnss/1.0/default/Gnss.cpp
+++ b/gnss/1.0/default/Gnss.cpp
@@ -676,7 +676,7 @@
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 @@
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;
}
diff --git a/gnss/1.0/default/service.cpp b/gnss/1.0/default/service.cpp
index 4e040c5..5a8acc1 100644
--- a/gnss/1.0/default/service.cpp
+++ b/gnss/1.0/default/service.cpp
@@ -8,5 +8,5 @@
using android::hardware::defaultPassthroughServiceImplementation;
int main() {
- return defaultPassthroughServiceImplementation<IGnss>("gnss");
+ return defaultPassthroughServiceImplementation<IGnss>();
}