summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-08-10 04:00:50 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-08-10 04:00:50 +0000
commit80069712ff96bc50b54ed1b70d947f9071d5d43b (patch)
tree6542c65c79c49916b917bd53de7451800ca31daa
parentc36dc6df6fc340f246ece229346cb86714748a52 (diff)
parent79276a5e333f00bd52a0446b184be81f88a484b7 (diff)
downloadinterfaces-android14-d1-s6-release.tar.gz
Change-Id: I6b2404dbbd1a3660ce8779a029224f975a7b3367
-rw-r--r--bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
index ee5527e62d..57a01c9d6f 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -440,6 +440,16 @@ void BluetoothAudioSession::ReportControlStatus(bool start_resp,
void BluetoothAudioSession::ReportLowLatencyModeAllowedChanged(bool allowed) {
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
+ // after audio session started. If low_latency_allowed_ is true, the session
+ // can support LOW_LATENCY and FREE LatencyMode.
+ if (low_latency_allowed_) {
+ if (std::find(latency_modes_.begin(), latency_modes_.end(),
+ LatencyMode::LOW_LATENCY) == latency_modes_.end()) {
+ LOG(INFO) << __func__ << " - insert LOW_LATENCY LatencyMode";
+ latency_modes_.push_back(LatencyMode::LOW_LATENCY);
+ }
+ }
if (observers_.empty()) {
LOG(WARNING) << __func__ << " - SessionType=" << toString(session_type_)
<< " has NO port state observer";