From 5f477d864b35e04f6789ab1ebebaff7ee7e43baf Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Tue, 17 Jan 2023 15:27:44 -0800 Subject: [PATCH] audio VTS: Limit mix ports that route to attached devices In tests that do not request and activate simulation of connection of external devices, limit the mix port query to return ports that can be routed to attached device ports only. Bug: 205884982 Test: atest VtsHalAudioCoreTargetTest Change-Id: I7e77b269c07b763a5080f42ebf7ec7d0fcaee195 --- audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp index 21ad0e642d..705fc6671a 100644 --- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp +++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp @@ -1894,9 +1894,9 @@ TEST_P(AudioCoreModule, AddRemoveEffectInvalidArguments) { TEST_P(AudioCoreModule, GetMmapPolicyInfos) { ASSERT_NO_FATAL_FAILURE(SetUpModuleConfig()); const std::vector mmapOutMixPorts = - moduleConfig->getMmapOutMixPorts(false /*attachedOnly*/, false /*singlePort*/); + moduleConfig->getMmapOutMixPorts(true /*attachedOnly*/, false /*singlePort*/); const std::vector mmapInMixPorts = - moduleConfig->getMmapInMixPorts(false /*attachedOnly*/, false /*singlePort*/); + moduleConfig->getMmapInMixPorts(true /*attachedOnly*/, false /*singlePort*/); const bool mmapSupported = (!mmapOutMixPorts.empty() || !mmapInMixPorts.empty()); for (const auto mmapPolicyType : {AudioMMapPolicyType::DEFAULT, AudioMMapPolicyType::EXCLUSIVE}) { @@ -2344,7 +2344,7 @@ class AudioStream : public AudioCoreModule { void HwGainHwVolume() { const auto ports = - moduleConfig->getMixPorts(IOTraits::is_input, false /*attachedOnly*/); + moduleConfig->getMixPorts(IOTraits::is_input, true /*attachedOnly*/); if (ports.empty()) { GTEST_SKIP() << "No mix ports"; } @@ -2383,7 +2383,7 @@ class AudioStream : public AudioCoreModule { // it as an invalid argument, or say that offloaded effects are not supported. void AddRemoveEffectInvalidArguments() { const auto ports = - moduleConfig->getMixPorts(IOTraits::is_input, false /*attachedOnly*/); + moduleConfig->getMixPorts(IOTraits::is_input, true /*attachedOnly*/); if (ports.empty()) { GTEST_SKIP() << "No mix ports"; } @@ -2664,7 +2664,7 @@ TEST_P(AudioStreamOut, RequireAsyncCallback) { } TEST_P(AudioStreamOut, AudioDescriptionMixLevel) { - const auto ports = moduleConfig->getOutputMixPorts(false /*attachedOnly*/); + const auto ports = moduleConfig->getOutputMixPorts(true /*attachedOnly*/); if (ports.empty()) { GTEST_SKIP() << "No output mix ports"; } @@ -2692,7 +2692,7 @@ TEST_P(AudioStreamOut, AudioDescriptionMixLevel) { } TEST_P(AudioStreamOut, DualMonoMode) { - const auto ports = moduleConfig->getOutputMixPorts(false /*attachedOnly*/); + const auto ports = moduleConfig->getOutputMixPorts(true /*attachedOnly*/); if (ports.empty()) { GTEST_SKIP() << "No output mix ports"; } @@ -2716,7 +2716,7 @@ TEST_P(AudioStreamOut, DualMonoMode) { } TEST_P(AudioStreamOut, LatencyMode) { - const auto ports = moduleConfig->getOutputMixPorts(false /*attachedOnly*/); + const auto ports = moduleConfig->getOutputMixPorts(true /*attachedOnly*/); if (ports.empty()) { GTEST_SKIP() << "No output mix ports"; }