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

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

Merge cherrypicks of ['googleplex-android-review.googlesource.com/22900658',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/22900658', 'googleplex-android-review.googlesource.com/23152794', 'googleplex-android-review.googlesource.com/23152778', 'googleplex-android-review.googlesource.com/22726306', 'googleplex-android-review.googlesource.com/21609715', 'googleplex-android-review.googlesource.com/22581496'] into security-aosp-tm-release.

Change-Id: I610a7d565e9284baf580078251e4c346d22caa76
parents bb6c888e d03a3020
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1740,14 +1740,14 @@ void bta_av_getcap_results(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
 ******************************************************************************/
void bta_av_setconfig_rej(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
  tBTA_AV_REJECT reject;
  uint8_t avdt_handle = p_data->ci_setconfig.avdt_handle;

  bta_av_adjust_seps_idx(p_scb, avdt_handle);
  bta_av_adjust_seps_idx(p_scb, p_scb->avdt_handle);

  LOG_INFO("%s: sep_idx=%d avdt_handle=%d bta_handle=0x%x", __func__,
           p_scb->sep_idx, p_scb->avdt_handle, p_scb->hndl);
  AVDT_ConfigRsp(p_scb->avdt_handle, p_scb->avdt_label, AVDT_ERR_UNSUP_CFG, 0);

  reject.bd_addr = p_data->str_msg.bd_addr;
  reject.bd_addr = p_scb->PeerAddress();
  reject.hndl = p_scb->hndl;

  tBTA_AV bta_av_data;
+4 −1
Original line number Diff line number Diff line
@@ -1002,9 +1002,12 @@ void bta_av_rc_msg(tBTA_AV_CB* p_cb, tBTA_AV_DATA* p_data) {
    av.remote_cmd.rc_handle = p_data->rc_msg.handle;
    (*p_cb->p_cback)(evt, &av);
    /* If browsing message, then free the browse message buffer */
    if (p_data->rc_msg.opcode == AVRC_OP_BROWSE &&
        p_data->rc_msg.msg.browse.p_browse_pkt != NULL) {
      bta_av_rc_free_browse_msg(p_cb, p_data);
    }
  }
}

/*******************************************************************************
 *
+2 −2
Original line number Diff line number Diff line
@@ -1290,14 +1290,14 @@ BT_HDR* avdt_msg_asmbl(AvdtpCcb* p_ccb, BT_HDR* p_buf) {
       * NOTE: The buffer is allocated above at the beginning of the
       * reassembly, and is always of size BT_DEFAULT_BUFFER_SIZE.
       */
      uint16_t buf_len = BT_DEFAULT_BUFFER_SIZE - sizeof(BT_HDR);
      size_t buf_len = BT_DEFAULT_BUFFER_SIZE - sizeof(BT_HDR);

      /* adjust offset and len of fragment for header byte */
      p_buf->offset += AVDT_LEN_TYPE_CONT;
      p_buf->len -= AVDT_LEN_TYPE_CONT;

      /* verify length */
      if ((p_ccb->p_rx_msg->offset + p_buf->len) > buf_len) {
      if (((size_t) p_ccb->p_rx_msg->offset + (size_t) p_buf->len) > buf_len) {
        /* won't fit; free everything */
        AVDT_TRACE_WARNING("%s: Fragmented message too big!", __func__);
        osi_free_and_reset((void**)&p_ccb->p_rx_msg);
+9 −3
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

#pragma once

#include <algorithm>
#include <queue>

#include "stack/gatt/gatt_int.h"
@@ -24,6 +25,7 @@

#define EATT_MIN_MTU_MPS (64)
#define EATT_DEFAULT_MTU (256)
#define EATT_MAX_TX_MTU  (1024)

namespace bluetooth {
namespace eatt {
@@ -58,12 +60,13 @@ class EattChannel {
  EattChannel(RawAddress& bda, uint16_t cid, uint16_t tx_mtu, uint16_t rx_mtu)
      : bda_(bda),
        cid_(cid),
        tx_mtu_(tx_mtu),
        rx_mtu_(rx_mtu),
        state_(EattChannelState::EATT_CHANNEL_PENDING),
        indicate_handle_(0),
        ind_ack_timer_(NULL),
        ind_confirmation_timer_(NULL) {}
        ind_confirmation_timer_(NULL) {
    EattChannelSetTxMTU(tx_mtu);
  }

  ~EattChannel() {
    if (ind_ack_timer_ != NULL) {
@@ -92,7 +95,10 @@ class EattChannel {
    }
    state_ = state;
  }
  void EattChannelSetTxMTU(uint16_t tx_mtu) { this->tx_mtu_ = tx_mtu; }

  void EattChannelSetTxMTU(uint16_t tx_mtu) {
    this->tx_mtu_ = std::min<uint16_t>(tx_mtu, EATT_MAX_TX_MTU);
  }
};

/* Interface class */
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ struct eatt_impl {
    if (is_local_cfg)
      channel->rx_mtu_ = p_cfg->mtu;
    else
      channel->tx_mtu_ = p_cfg->mtu;
      channel->EattChannelSetTxMTU(p_cfg->mtu);

    /* Go back to open state */
    channel->EattChannelSetState(EattChannelState::EATT_CHANNEL_OPENED);
Loading