diff --git a/audio/core/all-versions/vts/functional/6.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/6.0/AudioPrimaryHidlHalTest.cpp index c56445cc9e..30f8a7ade7 100644 --- a/audio/core/all-versions/vts/functional/6.0/AudioPrimaryHidlHalTest.cpp +++ b/audio/core/all-versions/vts/functional/6.0/AudioPrimaryHidlHalTest.cpp @@ -73,9 +73,12 @@ const std::vector& getOutputDeviceConfigParameters() { getCachedPolicyConfig().getModuleFromName(std::get(device)); for (const auto& ioProfile : module->getOutputProfiles()) { for (const auto& profile : ioProfile->getAudioProfiles()) { - auto configs = ConfigHelper::combineAudioConfig(profile->getChannels(), - profile->getSampleRates(), - profile->getFormat()); + const auto& channels = profile->getChannels(); + const auto& sampleRates = profile->getSampleRates(); + auto configs = ConfigHelper::combineAudioConfig( + vector(channels.begin(), channels.end()), + vector(sampleRates.begin(), sampleRates.end()), + profile->getFormat()); auto flags = ioProfile->getFlags(); for (auto& config : configs) { // Some combinations of flags declared in the config file require special @@ -125,9 +128,12 @@ const std::vector& getInputDeviceConfigParameters() { getCachedPolicyConfig().getModuleFromName(std::get(device)); for (const auto& ioProfile : module->getInputProfiles()) { for (const auto& profile : ioProfile->getAudioProfiles()) { - auto configs = ConfigHelper::combineAudioConfig(profile->getChannels(), - profile->getSampleRates(), - profile->getFormat()); + const auto& channels = profile->getChannels(); + const auto& sampleRates = profile->getSampleRates(); + auto configs = ConfigHelper::combineAudioConfig( + vector(channels.begin(), channels.end()), + vector(sampleRates.begin(), sampleRates.end()), + profile->getFormat()); for (const auto& config : configs) { result.emplace_back(device, config, AudioInputFlag(ioProfile->getFlags())); } diff --git a/audio/core/all-versions/vts/functional/ConfigHelper.h b/audio/core/all-versions/vts/functional/ConfigHelper.h index 604c0c50e6..48aae8c5b3 100644 --- a/audio/core/all-versions/vts/functional/ConfigHelper.h +++ b/audio/core/all-versions/vts/functional/ConfigHelper.h @@ -79,8 +79,8 @@ struct ConfigHelper { return {}; } - static vector combineAudioConfig(android::ChannelMaskSet channelMasks, - android::SampleRateSet sampleRates, + static vector combineAudioConfig(vector channelMasks, + vector sampleRates, audio_format_t format) { vector configs; configs.reserve(channelMasks.size() * sampleRates.size());