audio: Set connectedProfiles for non-attached device ports.
For external (non-attached) device ports that have dynamic
profiles, 'connectedProfiles' must be provided. They are
used when 'ModuleDebug.simulateDeviceConnections' is enabled.
Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
(cherry picked from commit a29393db39b35a4d6b819deef0861fc6fab048c5)
Change-Id: I69707d610c34f8f1eae9ef81768b76c40e985c0f
diff --git a/audio/aidl/default/Configuration.cpp b/audio/aidl/default/Configuration.cpp
index cf5f066..d09552b 100644
--- a/audio/aidl/default/Configuration.cpp
+++ b/audio/aidl/default/Configuration.cpp
@@ -135,6 +135,22 @@
return route;
}
+std::vector<AudioProfile> getStandard16And24BitPcmAudioProfiles() {
+ auto createStdPcmAudioProfile = [](const PcmType& pcmType) {
+ return AudioProfile{
+ .format = AudioFormatDescription{.type = AudioFormatType::PCM, .pcm = pcmType},
+ .channelMasks = {AudioChannelLayout::make<AudioChannelLayout::layoutMask>(
+ AudioChannelLayout::LAYOUT_MONO),
+ AudioChannelLayout::make<AudioChannelLayout::layoutMask>(
+ AudioChannelLayout::LAYOUT_STEREO)},
+ .sampleRates = {8000, 11025, 16000, 32000, 44100, 48000}};
+ };
+ return {
+ createStdPcmAudioProfile(PcmType::INT_16_BIT),
+ createStdPcmAudioProfile(PcmType::INT_24_BIT),
+ };
+}
+
// Primary (default) configuration:
//
// Device ports: