Copy audioConfig according to config discriminator am: d7f04f9f06

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1497981

Change-Id: I969536e3efed093eb2a7bd7ee833400464b9d306
This commit is contained in:
Grzegorz Kołodziejczyk 2020-11-20 09:10:37 +00:00 committed by Automerger Merge Worker
commit d06c0fc642

View file

@ -55,12 +55,17 @@ Return<void> BluetoothAudioProvider::startSession(
const V2_0::AudioConfiguration& audioConfig, startSession_cb _hidl_cb) {
AudioConfiguration audioConfig_2_1;
audioConfig_2_1.codecConfig() = audioConfig.codecConfig();
if (audioConfig.getDiscriminator() ==
V2_0::AudioConfiguration::hidl_discriminator::pcmConfig) {
audioConfig_2_1.pcmConfig() = {
.sampleRate = static_cast<SampleRate>(audioConfig.pcmConfig().sampleRate),
.sampleRate =
static_cast<SampleRate>(audioConfig.pcmConfig().sampleRate),
.channelMode = audioConfig.pcmConfig().channelMode,
.bitsPerSample = audioConfig.pcmConfig().bitsPerSample,
.dataIntervalUs = 0};
} else {
audioConfig_2_1.codecConfig() = audioConfig.codecConfig();
}
return startSession_2_1(hostIf, audioConfig_2_1, _hidl_cb);
}