[automerger skipped] Support for P256 curve in RKP for Strongbox am: 8785f89b1d am: 59737c281f -s ours am: b222638c56 -s ours am: d49ad26c63 -s ours am: 6d5bc560b9 -s ours am: 6dee7a8712 -s ours

am skip reason: Merged-In Ic38fd2318dd8749ae125f1e78d25f2722bd367e5 with SHA-1 fb213d6031 is already in history

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2962596

Change-Id: Ief7a1b22149adf9f017a2bc9905081f2fdee15e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
index ee5527e..57a01c9 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -440,6 +440,16 @@
 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";