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

Commit cb35058c authored by Hansong Zhang's avatar Hansong Zhang Committed by Automerger Merge Worker
Browse files

AVDT Flush Timeout is fixed am: d14496e9

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1437934

Change-Id: Ia4026c0439007a1dd54bcf26bbc5814446b5adae
parents cbca2c15 d14496e9
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -528,11 +528,9 @@ void avdt_ad_open_req(uint8_t type, AvdtpCcb* p_ccb, AvdtpScb* p_scb,
  if (type == AVDT_CHAN_SIG) {
    /* if signaling, get mtu from registration control block */
    p_tbl->my_mtu = kSignalMtu;
    p_tbl->my_flush_to = L2CAP_DEFAULT_FLUSH_TO;
  } else {
    /* otherwise get mtu from scb */
    p_tbl->my_mtu = kAudioMtu;
    p_tbl->my_flush_to = p_scb->stream_config.flush_to;

    /* also set scb_hdl in rt_tbl */
    avdtp_cb.ad.rt_tbl[avdt_ccb_to_idx(p_ccb)][p_tbl->tcid].scb_hdl =
+0 −3
Original line number Diff line number Diff line
@@ -647,7 +647,6 @@ class AvdtpTransportChannel {
  AvdtpTransportChannel()
      : peer_mtu(0),
        my_mtu(0),
        my_flush_to(0),
        lcid(0),
        tcid(0),
        ccb_idx(0),
@@ -658,7 +657,6 @@ class AvdtpTransportChannel {
  void Reset() {
    peer_mtu = 0;
    my_mtu = 0;
    my_flush_to = 0;
    lcid = 0;
    tcid = 0;
    ccb_idx = 0;
@@ -669,7 +667,6 @@ class AvdtpTransportChannel {

  uint16_t peer_mtu;     // L2CAP MTU of the peer device
  uint16_t my_mtu;       // Our MTU for this channel
  uint16_t my_flush_to;  // Our flush timeout for this channel
  uint16_t lcid;
  uint8_t tcid;       // Transport channel ID
  uint8_t ccb_idx;    // Channel control block for with this transport channel
+4 −5
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ static void avdt_sec_check_complete_term(const RawAddress* bd_addr,
    cfg.mtu_present = true;
    cfg.mtu = kSignalMtu;
    cfg.flush_to_present = true;
    cfg.flush_to = p_tbl->my_flush_to;
    cfg.flush_to = L2CAP_DEFAULT_FLUSH_TO;
    L2CA_ConfigReq(p_tbl->lcid, &cfg);
  } else {
    L2CA_ConnectRsp(*bd_addr, p_tbl->id, p_tbl->lcid, L2CAP_CONN_SECURITY_BLOCK,
@@ -140,7 +140,7 @@ static void avdt_sec_check_complete_orig(const RawAddress* bd_addr,
    cfg.mtu_present = true;
    cfg.mtu = kSignalMtu;
    cfg.flush_to_present = true;
    cfg.flush_to = p_tbl->my_flush_to;
    cfg.flush_to = L2CAP_DEFAULT_FLUSH_TO;
    L2CA_ConfigReq(p_tbl->lcid, &cfg);
  } else {
    avdt_l2c_disconnect(p_tbl->lcid);
@@ -182,7 +182,6 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid,
      /* allocate and set up entry; first channel is always signaling */
      p_tbl = avdt_ad_tc_tbl_alloc(p_ccb);
      p_tbl->my_mtu = kSignalMtu;
      p_tbl->my_flush_to = L2CAP_DEFAULT_FLUSH_TO;
      p_tbl->tcid = AVDT_CHAN_SIG;
      p_tbl->lcid = lcid;
      p_tbl->id = id;
@@ -249,7 +248,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid,
    cfg.mtu_present = true;
    cfg.mtu = p_tbl->my_mtu;
    cfg.flush_to_present = true;
    cfg.flush_to = p_tbl->my_flush_to;
    cfg.flush_to = L2CAP_DEFAULT_FLUSH_TO;
    L2CA_ConfigReq(lcid, &cfg);
  }
}
@@ -287,7 +286,7 @@ void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) {
          cfg.mtu_present = true;
          cfg.mtu = p_tbl->my_mtu;
          cfg.flush_to_present = true;
          cfg.flush_to = p_tbl->my_flush_to;
          cfg.flush_to = L2CAP_DEFAULT_FLUSH_TO;
          L2CA_ConfigReq(lcid, &cfg);
        } else {
          p_ccb = avdt_ccb_by_idx(p_tbl->ccb_idx);