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

Commit faf30d35 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

Fix for connection attempt after connection cancel

am: 95c949f4

Change-Id: I53d5bce8962f5e3789f0ae41c39bc916ffe85ca7
parents bba77fc1 95c949f4
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -242,8 +242,9 @@ bool gatt_disconnect(tGATT_TCB* p_tcb) {
      /* only LCB exist between remote device and local */
      ret = L2CA_RemoveFixedChnl(L2CAP_ATT_CID, p_tcb->peer_bda);
    } else {
      ret = L2CA_CancelBleConnectReq(p_tcb->peer_bda);
      if (!ret) gatt_set_ch_state(p_tcb, GATT_CH_CLOSE);
      L2CA_CancelBleConnectReq(p_tcb->peer_bda);
      gatt_cleanup_upon_disc(p_tcb->peer_bda, HCI_ERR_CONN_CAUSE_LOCAL_HOST, p_tcb->transport);
      return true;
    }
    gatt_set_ch_state(p_tcb, GATT_CH_CLOSING);
  } else {
@@ -356,6 +357,7 @@ bool gatt_act_connect(tGATT_REG* p_reg, const RawAddress& bd_addr,
                        p_reg->gatt_if))
        return false;
    } else if (st == GATT_CH_CLOSING) {
      LOG(INFO) << "Must finish disconnection before new connection";
      /* need to complete the closing first */
      return false;
    }