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

Commit ee9d195e 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 am: 6fe14d87 am: 731f7de0

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

Change-Id: Ic924ea7e92bf51b7e473b1efa6545d1e5e36ff28
parents c0bbc2ac 731f7de0
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ struct eatt_impl {

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

    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) {
    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) {
+1 −0
Original line number 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->transport = transport;
    p_tcb->peer_bda = bda;
    p_tcb->eatt = 0;
    return p_tcb;
  }