libaudiohal: Add optional "msd" devices factory
Adding code that attempts to get an instance of "msd" devices
factory. The factory isn't yet used, but having the code in place
ensures that we would know about any changes in HIDL services
discovery protocol.
Bug: 63901775
Test: audioserver starts even if "msd" HAL service is absent
Change-Id: Ia897127ba383fc05d139b633717992a5d5a4f920
diff --git a/media/libaudiohal/DevicesFactoryHalHidl.cpp b/media/libaudiohal/DevicesFactoryHalHidl.cpp
index 31da263..5b33592 100644
--- a/media/libaudiohal/DevicesFactoryHalHidl.cpp
+++ b/media/libaudiohal/DevicesFactoryHalHidl.cpp
@@ -43,6 +43,9 @@
ALOGE("Failed to obtain IDevicesFactory service, terminating process.");
exit(1);
}
+ // The MSD factory is optional
+ mDevicesFactoryMsd = IDevicesFactory::getService(AUDIO_HAL_SERVICE_NAME_MSD);
+ // TODO: Register death handler, and add 'restart' directive to audioserver.rc
}
DevicesFactoryHalHidl::~DevicesFactoryHalHidl() {