Merge "Report broacast audio config to HAL" into main am: 9534a2dc4c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3073926 Change-Id: Ibb0fb44518eb15a6711a41302fc7a72a6a17e64d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
a2dbddc48b
1 changed files with 34 additions and 11 deletions
|
@ -121,18 +121,41 @@ const AudioConfiguration BluetoothAudioSession::GetAudioConfig() {
|
|||
|
||||
void BluetoothAudioSession::ReportAudioConfigChanged(
|
||||
const AudioConfiguration& audio_config) {
|
||||
if (session_type_ !=
|
||||
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH &&
|
||||
session_type_ !=
|
||||
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::recursive_mutex> guard(mutex_);
|
||||
if (audio_config.getTag() != AudioConfiguration::leAudioConfig) {
|
||||
LOG(ERROR) << __func__ << " invalid audio config type for SessionType ="
|
||||
<< toString(session_type_);
|
||||
return;
|
||||
if (com::android::btaudio::hal::flags::leaudio_report_broadcast_ac_to_hal()) {
|
||||
if (session_type_ ==
|
||||
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
|
||||
session_type_ ==
|
||||
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
|
||||
if (audio_config.getTag() != AudioConfiguration::leAudioConfig) {
|
||||
LOG(ERROR) << __func__ << " invalid audio config type for SessionType ="
|
||||
<< toString(session_type_);
|
||||
return;
|
||||
}
|
||||
} else if (session_type_ ==
|
||||
SessionType::LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH) {
|
||||
if (audio_config.getTag() != AudioConfiguration::leAudioBroadcastConfig) {
|
||||
LOG(ERROR) << __func__ << " invalid audio config type for SessionType ="
|
||||
<< toString(session_type_);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
LOG(ERROR) << __func__ << " invalid SessionType ="
|
||||
<< toString(session_type_);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (session_type_ !=
|
||||
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH &&
|
||||
session_type_ !=
|
||||
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
|
||||
return;
|
||||
}
|
||||
if (audio_config.getTag() != AudioConfiguration::leAudioConfig) {
|
||||
LOG(ERROR) << __func__ << " invalid audio config type for SessionType ="
|
||||
<< toString(session_type_);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
audio_config_ = std::make_unique<AudioConfiguration>(audio_config);
|
||||
|
|
Loading…
Reference in a new issue