Loading system/stack/btm/btm_ble_bgconn.cc +0 −41 Original line number Diff line number Diff line Loading @@ -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()) { Loading Loading @@ -131,31 +115,6 @@ void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy) { btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type, 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 Loading system/stack/btm/btm_ble_int.h +0 −2 Original line number Diff line number Diff line Loading @@ -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); Loading system/test/mock/mock_stack_btm_ble_bgconn.cc +0 −7 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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(); Loading system/test/mock/mock_stack_btm_ble_bgconn.h +0 −10 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
system/stack/btm/btm_ble_bgconn.cc +0 −41 Original line number Diff line number Diff line Loading @@ -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()) { Loading Loading @@ -131,31 +115,6 @@ void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy) { btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type, 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 Loading
system/stack/btm/btm_ble_int.h +0 −2 Original line number Diff line number Diff line Loading @@ -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); Loading
system/test/mock/mock_stack_btm_ble_bgconn.cc +0 −7 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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(); Loading
system/test/mock/mock_stack_btm_ble_bgconn.h +0 −10 Original line number Diff line number Diff line Loading @@ -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 Loading