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

Commit cca9dfc8 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Send L2CA_DisconnectRsp from L2cap state machine

Instead of having client send it.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Id27fa866aaa059dcc7302d5b8a871087d42547ed
parent 5fbe10a3
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -326,11 +326,6 @@ void avct_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed) {
  if (p_lcb != NULL) {
    AVCT_TRACE_DEBUG("avct_l2c_disconnect_ind_cback: 0x%x, ch_state: %d", lcid,
                     p_lcb->ch_state);
    if (ack_needed) {
      /* send L2CAP disconnect response */
      L2CA_DisconnectRsp(lcid);
    }

    tAVCT_LCB_EVT avct_lcb_evt;
    avct_lcb_evt.result = result;
    avct_lcb_event(p_lcb, AVCT_LCB_LL_CLOSE_EVT, &avct_lcb_evt);
+0 −5
Original line number Diff line number Diff line
@@ -336,11 +336,6 @@ void avct_l2c_br_disconnect_ind_cback(uint16_t lcid, bool ack_needed) {
  p_lcb = avct_bcb_by_lcid(lcid);
  if (p_lcb == NULL) return;

  if (ack_needed) {
    /* send L2CAP disconnect response */
    L2CA_DisconnectRsp(lcid);
  }

  tAVCT_LCB_EVT avct_lcb_evt;
  avct_lcb_evt.result = result;
  avct_bcb_event(p_lcb, AVCT_LCB_LL_CLOSE_EVT, &avct_lcb_evt);
+0 −5
Original line number Diff line number Diff line
@@ -430,11 +430,6 @@ void avdt_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed) {
  /* look up info for this channel */
  p_tbl = avdt_ad_tc_tbl_by_lcid(lcid);
  if (p_tbl != NULL) {
    if (ack_needed) {
      /* send L2CAP disconnect response */
      L2CA_DisconnectRsp(lcid);
    }

    avdt_ad_tc_close_ind(p_tbl, 0);
  }
}
+0 −2
Original line number Diff line number Diff line
@@ -328,8 +328,6 @@ static void bnep_config_cfm(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) {
static void bnep_disconnect_ind(uint16_t l2cap_cid, bool ack_needed) {
  tBNEP_CONN* p_bcb;

  if (ack_needed) L2CA_DisconnectRsp(l2cap_cid);

  /* Find CCB based on CID */
  p_bcb = bnepu_find_bcb_by_cid(l2cap_cid);
  if (p_bcb == NULL) {
+0 −2
Original line number Diff line number Diff line
@@ -851,8 +851,6 @@ static void gap_disconnect_ind(uint16_t l2cap_cid, bool ack_needed) {
  p_ccb = gap_find_ccb_by_cid(l2cap_cid);
  if (p_ccb == NULL) return;

  if (ack_needed) L2CA_DisconnectRsp(l2cap_cid);

  p_ccb->p_callback(p_ccb->gap_handle, GAP_EVT_CONN_CLOSED, nullptr);
  gap_release_ccb(p_ccb);
}
Loading