Loading system/stack/Android.bp +6 −2 Original line number Diff line number Diff line Loading @@ -482,10 +482,12 @@ cc_test { "packages/modules/Bluetooth/system/utils/include", ], srcs: [ "test/gatt/gatt_sr_test.cc", "gatt/gatt_utils.cc", "test/common/mock_acl.cc", "test/common/mock_eatt.cc", "test/common/mock_gatt_layer.cc", "test/common/mock_main_shim.cc", "test/gatt/gatt_sr_test.cc", ], shared_libs: [ "libcutils", Loading Loading @@ -560,9 +562,11 @@ cc_test { "gatt/gatt_db.cc", "gatt/gatt_sr_hash.cc", "gatt/gatt_utils.cc", "test/gatt/mock_gatt_utils_ref.cc", "test/common/mock_acl.cc", "test/common/mock_eatt.cc", "test/common/mock_gatt_layer.cc", "test/common/mock_main_shim.cc", "test/gatt/mock_gatt_utils_ref.cc", "test/stack_gatt_sr_hash_test.cc", ], shared_libs: [ Loading system/stack/btm/btm_ble_bgconn.cc +7 −0 Original line number Diff line number Diff line Loading @@ -534,6 +534,12 @@ bool BTM_AcceptlistAdd(const RawAddress& address) { } if (bluetooth::shim::is_gd_acl_enabled()) { if (acl_check_and_clear_ignore_auto_connect_after_disconnect(address)) { LOG_WARN( "Unexpectedly found device address already in ignore auto connect " "device:%s", PRIVATE_ADDRESS(address)); } return bluetooth::shim::ACL_AcceptLeConnectionFrom( convert_to_address_with_type(address, btm_find_dev(address))); } Loading Loading @@ -582,6 +588,7 @@ void BTM_AcceptlistClear() { } if (bluetooth::shim::is_gd_acl_enabled()) { acl_clear_all_ignore_auto_connect_after_disconnect(); bluetooth::shim::ACL_IgnoreAllLeConnections(); return; } Loading system/stack/btm/btm_ble_gap.cc +11 −4 Original line number Diff line number Diff line Loading @@ -2497,11 +2497,18 @@ void btm_ble_update_mode_operation(uint8_t link_role, const RawAddress* bd_addr, if (bd_addr != nullptr) { const RawAddress bda(*bd_addr); if (bluetooth::shim::is_gd_acl_enabled()) { if (acl_check_and_clear_ignore_auto_connect_after_disconnect(bda)) { LOG_DEBUG( "Local disconnect initiated so skipping re-add to acceptlist " "device:%s", PRIVATE_ADDRESS(bda)); } else { if (!bluetooth::shim::ACL_AcceptLeConnectionFrom( convert_to_address_with_type(bda, btm_find_dev(bda)))) { LOG_ERROR("Unable to add to acceptlist as it is full:%s", PRIVATE_ADDRESS(bda)); } } } else { btm_ble_bgconn_cancel_if_disconnected(bda); } Loading system/stack/gatt/gatt_utils.cc +5 −0 Original line number Diff line number Diff line Loading @@ -26,10 +26,12 @@ #include "bt_target.h" // Must be first to define build configuration #include "main/shim/shim.h" #include "stack/btm/btm_sec.h" #include "stack/eatt/eatt.h" #include "stack/gatt/connection_manager.h" #include "stack/gatt/gatt_int.h" #include "stack/include/acl_api.h" #include "stack/include/l2cdefs.h" #include "stack/include/sdp_api.h" #include "types/bluetooth/uuid.h" Loading Loading @@ -1611,5 +1613,8 @@ uint8_t* gatt_dbg_op_name(uint8_t op_code) { bool gatt_auto_connect_dev_remove(tGATT_IF gatt_if, const RawAddress& bd_addr) { tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE); if (p_tcb) gatt_update_app_use_link_flag(gatt_if, p_tcb, false, false); if (bluetooth::shim::is_gd_acl_enabled()) { acl_add_to_ignore_auto_connect_after_disconnect(bd_addr); } return connection_manager::background_connect_remove(gatt_if, bd_addr); } system/stack/test/gatt/gatt_sr_test.cc +3 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,9 @@ #define MAX_UINT16 ((uint16_t)0xffff) bool MOCK_bluetooth_shim_is_gd_acl_enabled_ = true; std::map<std::string, int> mock_function_count_map; tGATT_CB gatt_cb; namespace { Loading Loading
system/stack/Android.bp +6 −2 Original line number Diff line number Diff line Loading @@ -482,10 +482,12 @@ cc_test { "packages/modules/Bluetooth/system/utils/include", ], srcs: [ "test/gatt/gatt_sr_test.cc", "gatt/gatt_utils.cc", "test/common/mock_acl.cc", "test/common/mock_eatt.cc", "test/common/mock_gatt_layer.cc", "test/common/mock_main_shim.cc", "test/gatt/gatt_sr_test.cc", ], shared_libs: [ "libcutils", Loading Loading @@ -560,9 +562,11 @@ cc_test { "gatt/gatt_db.cc", "gatt/gatt_sr_hash.cc", "gatt/gatt_utils.cc", "test/gatt/mock_gatt_utils_ref.cc", "test/common/mock_acl.cc", "test/common/mock_eatt.cc", "test/common/mock_gatt_layer.cc", "test/common/mock_main_shim.cc", "test/gatt/mock_gatt_utils_ref.cc", "test/stack_gatt_sr_hash_test.cc", ], shared_libs: [ Loading
system/stack/btm/btm_ble_bgconn.cc +7 −0 Original line number Diff line number Diff line Loading @@ -534,6 +534,12 @@ bool BTM_AcceptlistAdd(const RawAddress& address) { } if (bluetooth::shim::is_gd_acl_enabled()) { if (acl_check_and_clear_ignore_auto_connect_after_disconnect(address)) { LOG_WARN( "Unexpectedly found device address already in ignore auto connect " "device:%s", PRIVATE_ADDRESS(address)); } return bluetooth::shim::ACL_AcceptLeConnectionFrom( convert_to_address_with_type(address, btm_find_dev(address))); } Loading Loading @@ -582,6 +588,7 @@ void BTM_AcceptlistClear() { } if (bluetooth::shim::is_gd_acl_enabled()) { acl_clear_all_ignore_auto_connect_after_disconnect(); bluetooth::shim::ACL_IgnoreAllLeConnections(); return; } Loading
system/stack/btm/btm_ble_gap.cc +11 −4 Original line number Diff line number Diff line Loading @@ -2497,11 +2497,18 @@ void btm_ble_update_mode_operation(uint8_t link_role, const RawAddress* bd_addr, if (bd_addr != nullptr) { const RawAddress bda(*bd_addr); if (bluetooth::shim::is_gd_acl_enabled()) { if (acl_check_and_clear_ignore_auto_connect_after_disconnect(bda)) { LOG_DEBUG( "Local disconnect initiated so skipping re-add to acceptlist " "device:%s", PRIVATE_ADDRESS(bda)); } else { if (!bluetooth::shim::ACL_AcceptLeConnectionFrom( convert_to_address_with_type(bda, btm_find_dev(bda)))) { LOG_ERROR("Unable to add to acceptlist as it is full:%s", PRIVATE_ADDRESS(bda)); } } } else { btm_ble_bgconn_cancel_if_disconnected(bda); } Loading
system/stack/gatt/gatt_utils.cc +5 −0 Original line number Diff line number Diff line Loading @@ -26,10 +26,12 @@ #include "bt_target.h" // Must be first to define build configuration #include "main/shim/shim.h" #include "stack/btm/btm_sec.h" #include "stack/eatt/eatt.h" #include "stack/gatt/connection_manager.h" #include "stack/gatt/gatt_int.h" #include "stack/include/acl_api.h" #include "stack/include/l2cdefs.h" #include "stack/include/sdp_api.h" #include "types/bluetooth/uuid.h" Loading Loading @@ -1611,5 +1613,8 @@ uint8_t* gatt_dbg_op_name(uint8_t op_code) { bool gatt_auto_connect_dev_remove(tGATT_IF gatt_if, const RawAddress& bd_addr) { tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE); if (p_tcb) gatt_update_app_use_link_flag(gatt_if, p_tcb, false, false); if (bluetooth::shim::is_gd_acl_enabled()) { acl_add_to_ignore_auto_connect_after_disconnect(bd_addr); } return connection_manager::background_connect_remove(gatt_if, bd_addr); }
system/stack/test/gatt/gatt_sr_test.cc +3 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,9 @@ #define MAX_UINT16 ((uint16_t)0xffff) bool MOCK_bluetooth_shim_is_gd_acl_enabled_ = true; std::map<std::string, int> mock_function_count_map; tGATT_CB gatt_cb; namespace { Loading