Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3025c48 authored by Bao Do's avatar Bao Do Committed by Automerger Merge Worker
Browse files

Merge changes Ib6e25a60,I77e9426f into main am: 52afa7ae

parents 6e1a023b 52afa7ae
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -75,3 +75,13 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "a2dp_check_lea_iso_channel"
    namespace: "bluetooth"
    description: "Prevent A2DP stream from starting when LEA ISO channels are in use"
    bug: "346475618"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include "a2dp_encoding_aidl.h"

#include <bluetooth/log.h>
#include <com_android_bluetooth_flags.h>

#include <vector>

@@ -26,6 +27,7 @@
#include "audio_aidl_interfaces.h"
#include "bta/av/bta_av_int.h"
#include "btif/include/btif_common.h"
#include "btm_iso_api.h"
#include "codec_status_aidl.h"
#include "transport_instance.h"

@@ -97,6 +99,14 @@ BluetoothAudioCtrlAck A2dpTransport::StartRequest(bool is_low_latency) {
    return a2dp_ack_to_bt_audio_ctrl_ack(A2DP_CTRL_ACK_INCALL_FAILURE);
  }

  if (com::android::bluetooth::flags::a2dp_check_lea_iso_channel()) {
    // Don't send START request to stack while LEA sessions are in use
    if (hci::IsoManager::GetInstance()->GetNumberOfActiveIso() > 0) {
      log::error("LEA currently has active ISO channels");
      return a2dp_ack_to_bt_audio_ctrl_ack(A2DP_CTRL_ACK_FAILURE);
    }
  }

  if (btif_av_stream_started_ready(A2dpType::kSource)) {
    // Already started, ACK back immediately.
    return a2dp_ack_to_bt_audio_ctrl_ack(A2DP_CTRL_ACK_SUCCESS);
+4 −0
Original line number Diff line number Diff line
@@ -90,6 +90,10 @@ void IsoManager::DisconnectCis(uint16_t cis_handle, uint8_t reason) {
  pimpl_->iso_impl_->disconnect_cis(cis_handle, reason);
}

int IsoManager::GetNumberOfActiveIso() {
  return pimpl_->iso_impl_->get_number_of_active_iso();
}

void IsoManager::SetupIsoDataPath(
    uint16_t iso_handle, struct iso_manager::iso_data_path_params path_params) {
  pimpl_->iso_impl_->setup_iso_data_path(iso_handle, std::move(path_params));
+6 −0
Original line number Diff line number Diff line
@@ -342,6 +342,12 @@ struct iso_impl {
                       hci_reason_code_text((tHCI_REASON)(reason)).c_str()));
  }

  int get_number_of_active_iso() {
    int num_iso = conn_hdl_to_cis_map_.size() + conn_hdl_to_bis_map_.size();
    log::info("Current number of active_iso is {}", num_iso);
    return num_iso;
  }

  void on_setup_iso_data_path(uint8_t* stream, uint16_t /* len */) {
    uint8_t status;
    uint16_t conn_handle;
+5 −0
Original line number Diff line number Diff line
@@ -226,6 +226,11 @@ class IsoManager {
  virtual void HandleHciEvent(uint8_t sub_code, uint8_t* params,
                              uint16_t length);

  /**
   * Return the current number of ISO channels
   */
  virtual int GetNumberOfActiveIso();

  /**
   * Starts the IsoManager module
   */
Loading