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

Commit f9ddc970 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8681172 from 212d32be to tm-release

Change-Id: I8f065b058f2eb3e08e04622b1255650acb8b1a2b
parents c803f963 212d32be
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ constexpr audio_format_t kBluetoothDefaultAudioFormatBitsPerSample =
constexpr unsigned int kBluetoothDefaultInputBufferMs = 20;
constexpr unsigned int kBluetoothDefaultInputStateTimeoutMs = 20;

constexpr unsigned int kBluetoothDefaultOutputBufferMs = 2;
constexpr unsigned int kBluetoothDefaultOutputBufferMs = 10;
constexpr unsigned int kBluetoothSpatializerOutputBufferMs = 10;

constexpr audio_channel_mask_t kBluetoothDefaultOutputChannelModeMask =
+37 −8
Original line number Diff line number Diff line
@@ -31,8 +31,11 @@

#include "bta_le_audio_api.h"
#include "gap_api.h"
#include "gatt_api.h"
#include "gd/common/strings.h"
#include "le_audio_types.h"
#include "osi/include/allocator.h"
#include "osi/include/log.h"

using le_audio::types::acs_ac_record;

@@ -379,11 +382,24 @@ bool PrepareAseCtpEnable(const std::vector<struct ctp_enable>& confs,
                         std::vector<uint8_t>& value) {
  if (confs.size() == 0) return false;

  if (confs.size() > UINT8_MAX) {
    LOG_ERROR(" To many ASEs to update metadata");
    return false;
  }

  uint16_t msg_len = confs.size() * kCtpEnableMinLen + kAseNumSize + kCtpOpSize;
  std::for_each(confs.begin(), confs.end(),
                [&msg_len](const struct ctp_enable& conf) {
  for (auto& conf : confs) {
    if (msg_len > GATT_MAX_ATTR_LEN) {
      LOG_ERROR(" Message length above GATT maximum");
      return false;
    }
    if (conf.metadata.size() > UINT8_MAX) {
      LOG_ERROR(" ase[%d] metadata length is invalid", conf.ase_id);
      return false;
    }

    msg_len += conf.metadata.size();
                });
  }
  value.resize(msg_len);

  uint8_t* msg = value.data();
@@ -466,12 +482,25 @@ bool PrepareAseCtpUpdateMetadata(
    std::vector<uint8_t>& value) {
  if (confs.size() == 0) return false;

  if (confs.size() > UINT8_MAX) {
    LOG_ERROR(" To many ASEs to update metadata");
    return false;
  }

  uint16_t msg_len =
      confs.size() * kCtpUpdateMetadataMinLen + kAseNumSize + kCtpOpSize;
  std::for_each(confs.begin(), confs.end(),
                [&msg_len](const struct ctp_update_metadata& conf) {
  for (auto& conf : confs) {
    if (msg_len > GATT_MAX_ATTR_LEN) {
      LOG_ERROR(" Message length above GATT maximum");
      return false;
    }
    if (conf.metadata.size() > UINT8_MAX) {
      LOG_ERROR(" ase[%d] metadata length is invalid", conf.ase_id);
      return false;
    }

    msg_len += conf.metadata.size();
                });
  }
  value.resize(msg_len);

  uint8_t* msg = value.data();
+1 −1
Original line number Diff line number Diff line
@@ -516,7 +516,7 @@ bool PORT_IsOpening(RawAddress* bd_addr) {
      }

      LOG_INFO("RFC_MX_STATE_CONNECTED, found_port=%d, tRFC_PORT_STATE=%d",
               found_port, p_port->rfc.state);
               found_port, p_port != nullptr ? p_port->rfc.state : 0);
      if ((!found_port) ||
          (found_port && (p_port->rfc.state < RFC_STATE_OPENED))) {
        /* Port is not established yet. */
+0 −9
Original line number Diff line number Diff line
@@ -902,15 +902,6 @@ void smp_br_check_authorization_request(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
  }
  SMP_TRACE_DEBUG("%s: use h7 = %d", __func__, p_cb->key_derivation_h7_used);

  /* SMP over BR/EDR should always be used with CTKD, so derive LTK from
   * LK before receiving keys */
  if ((p_cb->role == HCI_ROLE_CENTRAL &&
       (p_cb->local_i_key & SMP_SEC_KEY_TYPE_ENC)) ||
      (p_cb->role == HCI_ROLE_PERIPHERAL &&
       (p_cb->local_r_key & SMP_SEC_KEY_TYPE_ENC))) {
    smp_generate_ltk(p_cb, p_data);
  }

  SMP_TRACE_DEBUG(
      "%s rcvs upgrades: i_keys=0x%x r_keys=0x%x (i-initiator r-responder)",
      __func__, p_cb->local_i_key, p_cb->local_r_key);
+1 −1
Original line number Diff line number Diff line
@@ -533,7 +533,7 @@ static void smp_generate_ltk_cont(uint16_t div, tSMP_CB* p_cb) {
void smp_generate_ltk(tSMP_CB* p_cb, UNUSED_ATTR tSMP_INT_DATA* p_data) {
  SMP_TRACE_DEBUG("%s", __func__);

  if (p_cb->smp_over_br) {
  if (smp_get_br_state() == SMP_BR_STATE_BOND_PENDING) {
    smp_br_process_link_key(p_cb, NULL);
    return;
  } else if (p_cb->le_secure_connections_mode_is_used) {