summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/stack/btm/btm_ble_bgconn.cc41
-rw-r--r--system/stack/btm/btm_ble_int.h2
-rw-r--r--system/test/mock/mock_stack_btm_ble_bgconn.cc7
-rw-r--r--system/test/mock/mock_stack_btm_ble_bgconn.h10
4 files changed, 0 insertions, 60 deletions
diff --git a/system/stack/btm/btm_ble_bgconn.cc b/system/stack/btm/btm_ble_bgconn.cc
index 249f9ed7f4..965e0d08a1 100644
--- a/system/stack/btm/btm_ble_bgconn.cc
+++ b/system/stack/btm/btm_ble_bgconn.cc
@@ -70,22 +70,6 @@ struct BgConnHash {
static std::unordered_map<RawAddress, BackgroundConnection, BgConnHash>
background_connections;
-/** This function is to stop auto connection procedure */
-static bool btm_ble_stop_auto_conn() {
- BTM_TRACE_EVENT("%s", __func__);
-
- if (!btm_cb.ble_ctr_cb.is_connection_state_connecting()) {
- LOG_DEBUG(
- "No need to stop auto connection procedure that is not connecting");
- return false;
- }
-
- btm_ble_create_conn_cancel();
-
- btm_cb.ble_ctr_cb.reset_acceptlist_process_in_progress();
- return true;
-}
-
const tBLE_BD_ADDR convert_to_address_with_type(
const RawAddress& bd_addr, const tBTM_SEC_DEV_REC* p_dev_rec) {
if (p_dev_rec == nullptr || !p_dev_rec->is_device_type_has_ble()) {
@@ -133,31 +117,6 @@ void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy) {
/*******************************************************************************
*
- * Function btm_ble_bgconn_cancel_if_disconnected
- *
- * Description If a device has been disconnected, it must be re-added to
- * the acceptlist. If needed, this function cancels a pending
- * initiate command in order to trigger restart of the initiate
- * command which in turn updates the acceptlist.
- *
- * Parameters bd_addr: updated device
- *
- ******************************************************************************/
-void btm_ble_bgconn_cancel_if_disconnected(const RawAddress& bd_addr) {
- if (!btm_cb.ble_ctr_cb.is_connection_state_connecting()) return;
-
- auto map_it = background_connections.find(bd_addr);
- if (map_it != background_connections.end()) {
- BackgroundConnection* connection = &map_it->second;
- if (!connection->in_controller_wl && !connection->pending_removal &&
- !BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE)) {
- btm_ble_stop_auto_conn();
- }
- }
-}
-
-/*******************************************************************************
- *
* Function btm_ble_suspend_bg_conn
*
* Description This function is to suspend an active background connection
diff --git a/system/stack/btm/btm_ble_int.h b/system/stack/btm/btm_ble_int.h
index d92b9537aa..8ca11f7a8c 100644
--- a/system/stack/btm/btm_ble_int.h
+++ b/system/stack/btm/btm_ble_int.h
@@ -99,8 +99,6 @@ extern bool btm_ble_resume_bg_conn(void);
extern void btm_ble_update_mode_operation(uint8_t link_role,
const RawAddress* bda,
tHCI_STATUS status);
-extern void btm_ble_bgconn_cancel_if_disconnected(const RawAddress& bd_addr);
-
/* BLE address management */
extern void btm_gen_resolvable_private_addr(
base::Callback<void(const RawAddress& rpa)> cb);
diff --git a/system/test/mock/mock_stack_btm_ble_bgconn.cc b/system/test/mock/mock_stack_btm_ble_bgconn.cc
index f98b6146e2..4658cfcce5 100644
--- a/system/test/mock/mock_stack_btm_ble_bgconn.cc
+++ b/system/test/mock/mock_stack_btm_ble_bgconn.cc
@@ -48,8 +48,6 @@ namespace stack_btm_ble_bgconn {
// Function state capture and return values, if needed
struct convert_to_address_with_type convert_to_address_with_type;
struct btm_update_scanner_filter_policy btm_update_scanner_filter_policy;
-struct btm_ble_bgconn_cancel_if_disconnected
- btm_ble_bgconn_cancel_if_disconnected;
struct btm_ble_suspend_bg_conn btm_ble_suspend_bg_conn;
struct btm_ble_resume_bg_conn btm_ble_resume_bg_conn;
struct BTM_BackgroundConnectAddressKnown BTM_BackgroundConnectAddressKnown;
@@ -75,11 +73,6 @@ void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy) {
test::mock::stack_btm_ble_bgconn::btm_update_scanner_filter_policy(
scan_policy);
}
-void btm_ble_bgconn_cancel_if_disconnected(const RawAddress& bd_addr) {
- mock_function_count_map[__func__]++;
- test::mock::stack_btm_ble_bgconn::btm_ble_bgconn_cancel_if_disconnected(
- bd_addr);
-}
bool btm_ble_suspend_bg_conn(void) {
mock_function_count_map[__func__]++;
return test::mock::stack_btm_ble_bgconn::btm_ble_suspend_bg_conn();
diff --git a/system/test/mock/mock_stack_btm_ble_bgconn.h b/system/test/mock/mock_stack_btm_ble_bgconn.h
index 68e308df33..f88cfb1d33 100644
--- a/system/test/mock/mock_stack_btm_ble_bgconn.h
+++ b/system/test/mock/mock_stack_btm_ble_bgconn.h
@@ -79,16 +79,6 @@ struct btm_update_scanner_filter_policy {
void operator()(tBTM_BLE_SFP scan_policy) { body(scan_policy); };
};
extern struct btm_update_scanner_filter_policy btm_update_scanner_filter_policy;
-// Name: btm_ble_bgconn_cancel_if_disconnected
-// Params: const RawAddress& bd_addr
-// Returns: void
-struct btm_ble_bgconn_cancel_if_disconnected {
- std::function<void(const RawAddress& bd_addr)> body{
- [](const RawAddress& bd_addr) {}};
- void operator()(const RawAddress& bd_addr) { body(bd_addr); };
-};
-extern struct btm_ble_bgconn_cancel_if_disconnected
- btm_ble_bgconn_cancel_if_disconnected;
// Name: btm_ble_suspend_bg_conn
// Params: void
// Returns: bool