Remove temporary workarounds in AIDL HAL config processing
Removed the code in DevicesFactoryHalAidl::openDevice which
was checking whether the module is actually published.
Removed the fallback to default surround sound config
when AIDL HAL provided an empty config (this is not allowed).
Bug: 205884982
Test: use CF with AIDL audio HAL
Change-Id: I1b614e62a28ae1662a3c7fccce62aa943da9431d
diff --git a/media/libaudiohal/impl/DevicesFactoryHalAidl.cpp b/media/libaudiohal/impl/DevicesFactoryHalAidl.cpp
index 8345cd2..c8cce96 100644
--- a/media/libaudiohal/impl/DevicesFactoryHalAidl.cpp
+++ b/media/libaudiohal/impl/DevicesFactoryHalAidl.cpp
@@ -83,24 +83,15 @@
if (name == nullptr || device == nullptr) {
return BAD_VALUE;
}
-
- // FIXME: Remove this call and the check for the supported module names
- // after implementing retrieval of module names on the framework side.
- // Currently it is still using the legacy XML config.
- std::vector<std::string> deviceNames;
- if (status_t status = getDeviceNames(&deviceNames); status != OK) {
- return status;
- }
std::shared_ptr<IModule> service;
- if (std::find(deviceNames.begin(), deviceNames.end(), name) != deviceNames.end()) {
- if (strcmp(name, "primary") == 0) name = "default";
- auto serviceName = std::string(IModule::descriptor) + "/" + name;
- service = IModule::fromBinder(
- ndk::SpAIBinder(AServiceManager_waitForService(serviceName.c_str())));
- ALOGE_IF(service == nullptr, "%s fromBinder %s failed", __func__, serviceName.c_str());
+ if (strcmp(name, "primary") == 0) name = "default";
+ auto serviceName = std::string(IModule::descriptor) + "/" + name;
+ service = IModule::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(serviceName.c_str())));
+ if (service == nullptr) {
+ ALOGE("%s fromBinder %s failed", __func__, serviceName.c_str());
+ return NO_INIT;
}
- // If the service is a nullptr, the device object will not be really functional,
- // but will not crash either.
*device = sp<DeviceHalAidl>::make(name, service);
return OK;
}