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
This commit is contained in:
David Li
2023-08-10 12:47:44 +08:00
committed by Mikhail Naganov
parent 76d87305d5
commit b089c0cfee
8 changed files with 67 additions and 143 deletions

View File

@@ -1627,14 +1627,17 @@ TEST_P(AudioCoreModule, TryConnectMissingDevice) {
if (ports.empty()) {
GTEST_SKIP() << "No external devices in the module.";
}
AudioPort ignored;
WithDebugFlags doNotSimulateConnections = WithDebugFlags::createNested(*debug);
doNotSimulateConnections.flags().simulateDeviceConnections = false;
ASSERT_NO_FATAL_FAILURE(doNotSimulateConnections.SetUp(module.get()));
for (const auto& port : ports) {
AudioPort portWithData = GenerateUniqueDeviceAddress(port);
EXPECT_STATUS(EX_ILLEGAL_STATE, module->connectExternalDevice(portWithData, &ignored))
<< "static port " << portWithData.toString();
AudioPort portWithData = GenerateUniqueDeviceAddress(port), connectedPort;
ScopedAStatus status = module->connectExternalDevice(portWithData, &connectedPort);
EXPECT_STATUS(EX_ILLEGAL_STATE, status) << "static port " << portWithData.toString();
if (status.isOk()) {
EXPECT_IS_OK(module->disconnectExternalDevice(connectedPort.id))
<< "when disconnecting device port ID " << connectedPort.id;
}
}
}