System-side vendor extension for handling vendor parameters
A mechanism for handling vendor parameters of the Core Audio HAL
is introduced. It is realized by means of a system side interface
'IHalAdapterVendorExtension' which can be implemented by the
vendor in order to provide bidirectional translation between raw
key-value pairs and structured VendorParameter parcelables.
If an instance of 'IHalAdapterVendorExtension' is provided
(for example, via a system ext partition), the audio framework
will use it in order to process parameters that do not map
to methods and fields of AOSP Core Audio HAL interfaces,
and call 'IModule|IStreamCommon.get|setVendorParameters'.
Bug: 274433842
Bug: 278976019
Test: atest CoreAudioHalAidlTest
Change-Id: I8e77238d85cfa91bd7b53e20ad42bd195160fb04
diff --git a/media/libaudiohal/impl/DeviceHalAidl.h b/media/libaudiohal/impl/DeviceHalAidl.h
index 9b1066a..45768a3 100644
--- a/media/libaudiohal/impl/DeviceHalAidl.h
+++ b/media/libaudiohal/impl/DeviceHalAidl.h
@@ -20,6 +20,7 @@
#include <set>
#include <vector>
+#include <aidl/android/media/audio/IHalAdapterVendorExtension.h>
#include <aidl/android/hardware/audio/core/BpModule.h>
#include <android-base/thread_annotations.h>
#include <media/audiohal/DeviceHalInterface.h>
@@ -199,7 +200,8 @@
// Must not be constructed directly by clients.
DeviceHalAidl(
const std::string& instance,
- const std::shared_ptr<::aidl::android::hardware::audio::core::IModule>& module);
+ const std::shared_ptr<::aidl::android::hardware::audio::core::IModule>& module,
+ const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension>& vext);
~DeviceHalAidl() override = default;
@@ -210,6 +212,7 @@
status_t createOrUpdatePortConfig(
const ::aidl::android::media::audio::common::AudioPortConfig& requestedPortConfig,
PortConfigs::iterator* result, bool *created);
+ status_t filterAndRetrieveBtA2dpParameters(AudioParameter &keys, AudioParameter *result);
status_t filterAndUpdateBtA2dpParameters(AudioParameter ¶meters);
status_t filterAndUpdateBtHfpParameters(AudioParameter ¶meters);
status_t filterAndUpdateBtLeParameters(AudioParameter ¶meters);
@@ -288,6 +291,7 @@
const std::string mInstance;
const std::shared_ptr<::aidl::android::hardware::audio::core::IModule> mModule;
+ const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension> mVendorExt;
const std::shared_ptr<::aidl::android::hardware::audio::core::ITelephony> mTelephony;
const std::shared_ptr<::aidl::android::hardware::audio::core::IBluetooth> mBluetooth;
const std::shared_ptr<::aidl::android::hardware::audio::core::IBluetoothA2dp> mBluetoothA2dp;