memtrack 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
Bug: 33844934
Change-Id: Ide36b5470a393b5ed0f60fd37661dd50d0db817b
diff --git a/memtrack/1.0/default/Memtrack.cpp b/memtrack/1.0/default/Memtrack.cpp
index cc2d341..33a6906 100644
--- a/memtrack/1.0/default/Memtrack.cpp
+++ b/memtrack/1.0/default/Memtrack.cpp
@@ -73,19 +73,19 @@
}
-IMemtrack* HIDL_FETCH_IMemtrack(const char* name) {
+IMemtrack* HIDL_FETCH_IMemtrack(const char* /* name */) {
const hw_module_t* hw_module = nullptr;
const memtrack_module_t* memtrack_module = nullptr;
- int err = hw_get_module(name, &hw_module);
+ int err = hw_get_module(MEMTRACK_HARDWARE_MODULE_ID, &hw_module);
if (err) {
- ALOGE ("hw_get_module %s failed: %d", name, err);
+ ALOGE ("hw_get_module %s failed: %d", MEMTRACK_HARDWARE_MODULE_ID, err);
return nullptr;
}
if (!hw_module->methods || !hw_module->methods->open) {
memtrack_module = reinterpret_cast<const memtrack_module_t*>(hw_module);
} else {
- err = hw_module->methods->open(hw_module, name,
+ err = hw_module->methods->open(hw_module, MEMTRACK_HARDWARE_MODULE_ID,
reinterpret_cast<hw_device_t**>(const_cast<memtrack_module_t**>(&memtrack_module)));
if (err) {
ALOGE("Passthrough failed to load legacy HAL.");
diff --git a/memtrack/1.0/default/service.cpp b/memtrack/1.0/default/service.cpp
index f705b15..f079743 100644
--- a/memtrack/1.0/default/service.cpp
+++ b/memtrack/1.0/default/service.cpp
@@ -23,5 +23,5 @@
using android::hardware::defaultPassthroughServiceImplementation;
int main() {
- return defaultPassthroughServiceImplementation<IMemtrack>("memtrack");
+ return defaultPassthroughServiceImplementation<IMemtrack>();
}