libaudiohal@aidl: Implement setConnectedState
Implement the following methods in DeviceHalAidl:
- getAudioPort (both overloads)
- setAudioPortConfig
- setConnectedState
Add DeviceHalInterface::setSimulateDeviceConnections.
This method only works for the AIDL HAL and allows
testing external device connections in unit tests.
Plumb setSimulateDeviceConnections via the audio
framework to expose to libaudioclient tests.
Make conversions to/from AudioDevice and legacy
to use a corresponding variant for the address.
Fix invalid addresses in audiopolicy_tests.
Bug: 273252382
Test: atest audiopolicy_tests
Test: atest audiosystem_tests
Test: atest audio_aidl_conversion_tests
Change-Id: I9ed13b3a464496740f00a6553b1e03a3f884db74
diff --git a/media/libaudiohal/impl/DeviceHalHidl.h b/media/libaudiohal/impl/DeviceHalHidl.h
index 30fbd6d..afaad51 100644
--- a/media/libaudiohal/impl/DeviceHalHidl.h
+++ b/media/libaudiohal/impl/DeviceHalHidl.h
@@ -126,6 +126,11 @@
status_t setConnectedState(const struct audio_port_v7 *port, bool connected) override;
+ status_t setSimulateDeviceConnections(bool enabled __unused) override {
+ // Only supported by AIDL HALs.
+ return INVALID_OPERATION;
+ }
+
error::Result<audio_hw_sync_t> getHwAvSync() override;
status_t dump(int fd, const Vector<String16>& args) override;