summaryrefslogtreecommitdiff
path: root/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
diff options
context:
space:
mode:
authorChen Chen <cncn@google.com>2022-02-11 00:53:24 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-02-11 00:53:24 +0000
commit9e09eec46bba14859fb0924c1c00cff827c8b682 (patch)
treec185a3882ce96c9d8f5f05c3ee9c0008cadbfa2c /bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
parent3e8d4a1e8e65f8695a1c031a2da561ac59699aa9 (diff)
parent81f38e55c1916d4e08f40bd8b68492011df839bb (diff)
Merge "Spatial Audio: Implement setLowLatencyAllowed functions in BluetoothAudioSession"
Diffstat (limited to 'bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp')
-rw-r--r--bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
index dd29011625..967b6f3825 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -416,6 +416,22 @@ void BluetoothAudioSession::ReportControlStatus(bool start_resp,
}
}
+void BluetoothAudioSession::ReportLowLatencyModeAllowedChanged(bool allowed) {
+ std::lock_guard<std::recursive_mutex> guard(mutex_);
+ if (observers_.empty()) {
+ LOG(WARNING) << __func__ << " - SessionType=" << toString(session_type_)
+ << " has NO port state observer";
+ return;
+ }
+ for (auto& observer : observers_) {
+ uint16_t cookie = observer.first;
+ std::shared_ptr<PortStatusCallbacks> callback = observer.second;
+ LOG(INFO) << __func__ << " - allowed="
+ << allowed ? " allowed" : " disallowed";
+ callback->low_latency_mode_allowed_cb_(cookie, allowed);
+ }
+}
+
bool BluetoothAudioSession::GetPresentationPosition(
PresentationPosition& presentation_position) {
std::lock_guard<std::recursive_mutex> guard(mutex_);