summaryrefslogtreecommitdiff
path: root/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
diff options
context:
space:
mode:
authorChen Chen <cncn@google.com>2022-02-09 13:27:35 -0800
committerChen Chen <cncn@google.com>2022-02-10 22:10:56 +0000
commit81f38e55c1916d4e08f40bd8b68492011df839bb (patch)
treefe6f8b4fe268dd081078155454bdb8726f7b5834 /bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
parent8b389e11236f9e2ded7f988555d77f4be7631707 (diff)
Spatial Audio: Implement setLowLatencyAllowed functions in BluetoothAudioSession
Bug: 214615268 Test: Build: Tag: #feature Change-Id: I01c182b46fe72ee8f7c8e12e59ea2413c423b061
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 96cd9ef6cb..57ca6ca3b9 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -410,6 +410,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_);