libaudiohal: Align use of get_audio_port_v7 with default wrapper
Use the same logic when calling get_audio_port_v7
as the default wrapper, with separation for pre-V7
and V7 versions of the code.
Bug: 160352965
Test: check audio on device
also, use a modified APM config with USB Audio on 'usb' module
Change-Id: I5a6e2164b43d086aec6ffad5300edbade04cca1f
diff --git a/media/libaudiohal/impl/DeviceHalLocal.cpp b/media/libaudiohal/impl/DeviceHalLocal.cpp
index aa9e477..af7dc1a 100644
--- a/media/libaudiohal/impl/DeviceHalLocal.cpp
+++ b/media/libaudiohal/impl/DeviceHalLocal.cpp
@@ -181,6 +181,12 @@
}
status_t DeviceHalLocal::getAudioPort(struct audio_port_v7 *port) {
+#if MAJOR_VERSION >= 7
+ if (version() >= AUDIO_DEVICE_API_VERSION_3_2) {
+ // get_audio_port_v7 is mandatory if legacy HAL support this API version.
+ return mDev->get_audio_port_v7(mDev, port);
+ }
+#endif
struct audio_port audioPort = {};
audio_populate_audio_port(port, &audioPort);
status_t status = getAudioPort(&audioPort);