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

Commit 986face4 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Remove unused API L2CA_CancelBleConnectReq

Test: cert/run
Tag: #gd-refactor
Bug: 141555841
Change-Id: Ie2e3ce9fcadbb98036bc38db2b3645b0e05009a3
parent 9fefdc6a
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -759,19 +759,6 @@ extern bool L2CA_RemoveFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda);
extern bool L2CA_SetFixedChannelTout(const RawAddress& rem_bda,
                                     uint16_t fixed_cid, uint16_t idle_tout);

/*******************************************************************************
 *
 *  Function        L2CA_CancelBleConnectReq
 *
 *  Description     Cancel a pending connection attempt to a BLE device.
 *
 *  Parameters:     BD Address of remote
 *
 *  Return value:   true if connection was cancelled
 *
 ******************************************************************************/
extern bool L2CA_CancelBleConnectReq(const RawAddress& rem_bda);

extern bool L2CA_UpdateBleConnParams(const RawAddress& rem_bda,
                                     uint16_t min_int, uint16_t max_int,
                                     uint16_t latency, uint16_t timeout,
+0 −32
Original line number Diff line number Diff line
@@ -56,38 +56,6 @@ static void l2cble_start_conn_update(tL2C_LCB* p_lcb);
extern void gatt_notify_conn_update(const RawAddress& remote, uint16_t interval,
                                    uint16_t latency, uint16_t timeout,
                                    tHCI_STATUS status);
/*******************************************************************************
 *
 *  Function        L2CA_CancelBleConnectReq
 *
 *  Description     Cancel a pending connection attempt to a BLE device.
 *
 *  Parameters:     BD Address of remote
 *
 *  Return value:   true if connection was cancelled
 *
 ******************************************************************************/
bool L2CA_CancelBleConnectReq(const RawAddress& rem_bda) {
  tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(rem_bda, BT_TRANSPORT_LE);

  if (BTM_IsAclConnectionUp(rem_bda, BT_TRANSPORT_LE)) {
    if (p_lcb != NULL && p_lcb->link_state == LST_CONNECTING) {
      L2CAP_TRACE_WARNING("%s - disconnecting the LE link", __func__);
      L2CA_RemoveFixedChnl(L2CAP_ATT_CID, rem_bda);
      return (true);
    }
  }

  acl_cancel_le_connection(rem_bda);

  /* Do not remove lcb if an LE link is already up as a peripheral */
  if (p_lcb != NULL && !(p_lcb->IsLinkRolePeripheral() &&
                         BTM_IsAclConnectionUp(rem_bda, BT_TRANSPORT_LE))) {
    p_lcb->SetDisconnectReason(L2CAP_CONN_CANCEL);
    l2cu_release_lcb(p_lcb);
  }
  return (true);
}

/*******************************************************************************
 *
+0 −4
Original line number Diff line number Diff line
@@ -43,10 +43,6 @@ extern std::map<std::string, int> mock_function_count_map;
#define UNUSED_ATTR
#endif

bool L2CA_CancelBleConnectReq(const RawAddress& rem_bda) {
  mock_function_count_map[__func__]++;
  return false;
}
bool L2CA_EnableUpdateBleConnParams(const RawAddress& rem_bda, bool enable) {
  mock_function_count_map[__func__]++;
  return false;