From 9daf187ec6a87367de6958ebdcd028167122d4f1 Mon Sep 17 00:00:00 2001 From: Yuyang Huang Date: Wed, 7 Aug 2024 21:16:53 +0000 Subject: [PATCH] improve condition check for LE audio session Bug: 345303008 Change-Id: Ic360f5463dc9515047dc3cdf3e69564809ea06d3 Test: m packages/modules/Bluetooth Flag: exempt, no logical change --- .../aidl_session/BluetoothAudioSession.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp index d0f2a26e68..4fe2b376b4 100644 --- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp +++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp @@ -145,15 +145,18 @@ void BluetoothAudioSession::ReportAudioConfigChanged( return; } } else { - if (session_type_ != - SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH && - session_type_ != + 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_); + if (audio_config.getTag() != AudioConfiguration::leAudioConfig) { + LOG(ERROR) << __func__ << " invalid audio config type for SessionType =" + << toString(session_type_); + return; + } + } else { + LOG(ERROR) << __func__ + << " invalid SessionType =" << toString(session_type_); return; } }