audio: Fix remote submix module device ports handling
- remove the default address "0" for IN_SUBMIX and OUT_SUBMIX;
- remove the profiles in the device port and assign profiles when
connecting;
- make remote submix input to use "virtual" connection type,
same as the output;
- fix ModuleConfig in VTS to avoid returning devices with virtual
connections as "external devices" because they can actually
be connected even when connection simulation is disabled;
- fix TryConnectMissingDevice VTS test to disconnect the device
if the operation has unexpectedly succeeded.
Bug: 286914845
Bug: 294976817
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ife11c9c356d1b5dc587d08cef47294e3b29f65c5
diff --git a/audio/aidl/vts/ModuleConfig.cpp b/audio/aidl/vts/ModuleConfig.cpp
index 8c448a8..7213034 100644
--- a/audio/aidl/vts/ModuleConfig.cpp
+++ b/audio/aidl/vts/ModuleConfig.cpp
@@ -30,6 +30,7 @@
using aidl::android::hardware::audio::common::isBitPositionFlagSet;
using aidl::android::hardware::audio::core::IModule;
using aidl::android::media::audio::common::AudioChannelLayout;
+using aidl::android::media::audio::common::AudioDeviceDescription;
using aidl::android::media::audio::common::AudioDeviceType;
using aidl::android::media::audio::common::AudioEncapsulationMode;
using aidl::android::media::audio::common::AudioFormatDescription;
@@ -96,7 +97,10 @@
} else {
mAttachedSinkDevicePorts.insert(port.id);
}
- } else if (port.profiles.empty()) {
+ } else if (devicePort.device.type.connection != AudioDeviceDescription::CONNECTION_VIRTUAL
+ // The "virtual" connection is used for remote submix which is a dynamic
+ // device but it can be connected and used w/o external hardware.
+ && port.profiles.empty()) {
mExternalDevicePorts.insert(port.id);
}
}