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

Commit 6fe14d87 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Automerger Merge Worker
Browse files

eatt: Fix eatt counter in tcb am: 698b89cf am: b067940a

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

Change-Id: Ib8fe61a5b397bc51ec1a1217f9a318086bed9229
parents 0747cc2a b067940a
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -93,7 +93,6 @@ struct eatt_impl {


  void remove_channel_by_cid(eatt_device* eatt_dev, uint16_t lcid) {
  void remove_channel_by_cid(eatt_device* eatt_dev, uint16_t lcid) {
    eatt_dev->eatt_channels.erase(lcid);
    eatt_dev->eatt_channels.erase(lcid);
    eatt_dev->eatt_tcb_->eatt--;


    if (eatt_dev->eatt_channels.size() == 0) eatt_dev->eatt_tcb_ = NULL;
    if (eatt_dev->eatt_channels.size() == 0) eatt_dev->eatt_tcb_ = NULL;
  }
  }
@@ -240,7 +239,14 @@ struct eatt_impl {


  void eatt_l2cap_disconnect_ind(uint16_t lcid, bool please_confirm) {
  void eatt_l2cap_disconnect_ind(uint16_t lcid, bool please_confirm) {
    LOG(INFO) << __func__ << " cid: " << loghex(lcid);
    LOG(INFO) << __func__ << " cid: " << loghex(lcid);
    remove_channel_by_cid(lcid);
    eatt_device* eatt_dev = find_device_by_cid(lcid);
    if (!eatt_dev) {
      LOG(ERROR) << __func__ << " unknown cid: " << loghex(lcid);
      return;
    }

    eatt_dev->eatt_tcb_->eatt--;
    remove_channel_by_cid(eatt_dev, lcid);
  }
  }


  void eatt_l2cap_data_ind(uint16_t lcid, BT_HDR* data_p) {
  void eatt_l2cap_data_ind(uint16_t lcid, BT_HDR* data_p) {
+1 −0
Original line number Original line Diff line number Diff line
@@ -445,6 +445,7 @@ tGATT_TCB* gatt_allocate_tcb_by_bdaddr(const RawAddress& bda,
    p_tcb->tcb_idx = i;
    p_tcb->tcb_idx = i;
    p_tcb->transport = transport;
    p_tcb->transport = transport;
    p_tcb->peer_bda = bda;
    p_tcb->peer_bda = bda;
    p_tcb->eatt = 0;
    return p_tcb;
    return p_tcb;
  }
  }