Remove unused API L2CA_CancelBleConnectReq
Test: cert/run
Tag: #gd-refactor
Bug: 141555841
Change-Id: Ie2e3ce9fcadbb98036bc38db2b3645b0e05009a3
diff --git a/system/stack/include/l2c_api.h b/system/stack/include/l2c_api.h
index ac5872b..80efdf6 100644
--- a/system/stack/include/l2c_api.h
+++ b/system/stack/include/l2c_api.h
@@ -759,19 +759,6 @@
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,
diff --git a/system/stack/l2cap/l2c_ble.cc b/system/stack/l2cap/l2c_ble.cc
index ab8da97..5b95f3f 100644
--- a/system/stack/l2cap/l2c_ble.cc
+++ b/system/stack/l2cap/l2c_ble.cc
@@ -56,38 +56,6 @@
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);
-}
/*******************************************************************************
*
diff --git a/system/stack/test/common/mock_l2cap_l2c_ble.cc b/system/stack/test/common/mock_l2cap_l2c_ble.cc
index e06e11b..92db303 100644
--- a/system/stack/test/common/mock_l2cap_l2c_ble.cc
+++ b/system/stack/test/common/mock_l2cap_l2c_ble.cc
@@ -43,10 +43,6 @@
#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;