Minor handle refine for setLowLatencyModeAllowed
setLowLatencyModeAllowed API is only used for A2DP offload session. For
this case, we shouldn't report ReportLowLatencyModeAllowedChanged
callback for the other session
Bug: 270987427
Test: atest VtsHalBluetoothAudioTargetTest
Change-Id: I1991ee93b3523717c6ca26b1638e34a196253a5b
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
index e5cf53c..c283148 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -439,6 +439,9 @@
}
void BluetoothAudioSession::ReportLowLatencyModeAllowedChanged(bool allowed) {
+ if (session_type_ != SessionType::A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH) {
+ return;
+ }
std::lock_guard<std::recursive_mutex> guard(mutex_);
low_latency_allowed_ = allowed;
// TODO(b/294498919): Remove this after there is API to update latency mode