Spatial Audio: Implement setLowLatencyAllowed functions in BluetoothAudioSession

Bug: 214615268
Test: Build:
Tag: #feature
Change-Id: I01c182b46fe72ee8f7c8e12e59ea2413c423b061
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
index 96cd9ef..57ca6ca 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -410,6 +410,22 @@
   }
 }
 
+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_);