OSDN Git Service

Remove unused API L2CA_CancelBleConnectReq
authorHansong Zhang <hsz@google.com>
Wed, 13 Jan 2021 05:39:42 +0000 (21:39 -0800)
committerHansong Zhang <hsz@google.com>
Wed, 13 Jan 2021 19:45:37 +0000 (11:45 -0800)
Test: cert/run
Tag: #gd-refactor
Bug: 141555841
Change-Id: Ie2e3ce9fcadbb98036bc38db2b3645b0e05009a3

stack/include/l2c_api.h
stack/l2cap/l2c_ble.cc
stack/test/common/mock_l2cap_l2c_ble.cc

index ac5872b..80efdf6 100644 (file)
@@ -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,
index ab8da97..5b95f3f 100644 (file)
@@ -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);
-}
 
 /*******************************************************************************
  *
index e06e11b..92db303 100644 (file)
@@ -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;