libaudiohal@aidl: Make IHalAdapterVendorExtension mandatory
Since IHalAdapterVendorExtension is not stable, it can not be
included into the framework manifest, and thus `isDeclared`
check will never succeed (due to a bug, it could be included
previously, but it is now fixed).
This service is necessary for any vendor because all vendor
HAL implementations have some vendor-specific parameters.
An example implementation is added, which is used by Cuttlefish
and also added to GSI system_ext.
Bug: 321651892
Test: atest audiorouting_tests
Change-Id: Ib529250349da289cecb26bb965f1bfc8e37dc893
diff --git a/media/libaudiohal/impl/DevicesFactoryHalAidl.h b/media/libaudiohal/impl/DevicesFactoryHalAidl.h
index 17bfe43..2a3a9e7 100644
--- a/media/libaudiohal/impl/DevicesFactoryHalAidl.h
+++ b/media/libaudiohal/impl/DevicesFactoryHalAidl.h
@@ -45,10 +45,7 @@
private:
const std::shared_ptr<::aidl::android::hardware::audio::core::IConfig> mConfig;
- std::optional<std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension>>
- mVendorExt;
-
- std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension> getVendorExtension();
+ const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension> mVendorExt;
~DevicesFactoryHalAidl() = default;
};