Loading system/stack/gatt/connection_manager.cc +8 −2 Original line number Diff line number Diff line Loading @@ -397,6 +397,10 @@ bool background_connect_remove(uint8_t app_id, const RawAddress& address) { return true; } bool is_background_connection(const RawAddress& address) { return bgconn_dev.find(address) != bgconn_dev.end(); } /** deregister all related background connetion device. */ void on_app_deregistered(uint8_t app_id) { LOG_DEBUG("app_id=%d", static_cast<int>(app_id)); Loading Loading @@ -528,13 +532,15 @@ bool direct_connect_remove(uint8_t app_id, const RawAddress& address) { ADDRESS_TO_LOGGABLE_CSTR(address)); auto it = bgconn_dev.find(address); if (it == bgconn_dev.end()) { LOG_WARN("Unable to find background connection to remove"); LOG_WARN("Unable to find background connection to remove peer:%s", ADDRESS_TO_LOGGABLE_CSTR(address)); return false; } auto app_it = it->second.doing_direct_conn.find(app_id); if (app_it == it->second.doing_direct_conn.end()) { LOG_WARN("Unable to find direct connection to remove"); LOG_WARN("Unable to find direct connection to remove peer:%s", ADDRESS_TO_LOGGABLE_CSTR(address)); return false; } Loading system/stack/gatt/connection_manager.h +2 −0 Original line number Diff line number Diff line Loading @@ -61,4 +61,6 @@ extern void dump(int fd); extern void on_connection_timed_out(uint8_t app_id, const RawAddress& address); extern void on_connection_timed_out_from_shim(const RawAddress& address); extern bool is_background_connection(const RawAddress& address); } // namespace connection_manager system/stack/gatt/gatt_utils.cc +12 −5 Original line number Diff line number Diff line Loading @@ -1468,11 +1468,18 @@ bool gatt_cancel_open(tGATT_IF gatt_if, const RawAddress& bda) { } if (!connection_manager::direct_connect_remove(gatt_if, bda)) { if (!connection_manager::is_background_connection(bda)) { BTM_AcceptlistRemove(bda); LOG_INFO( "GATT connection manager has no record but removed filter acceptlist " "gatt_if:%hhu peer:%s", "Gatt connection manager has no background record but " " removed filter acceptlist gatt_if:%hhu peer:%s", gatt_if, ADDRESS_TO_LOGGABLE_CSTR(bda)); } else { LOG_INFO( "Gatt connection manager maintains a background record" " preserving filter acceptlist gatt_if:%hhu peer:%s", gatt_if, ADDRESS_TO_LOGGABLE_CSTR(bda)); } } return true; } Loading system/stack/test/gatt/gatt_sr_test.cc +2 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ bool background_connect_remove(uint8_t app_id, const RawAddress& address) { bool direct_connect_remove(uint8_t app_id, const RawAddress& address) { return false; } bool is_background_connection(const RawAddress& address) { return false; } } // namespace connection_manager BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, tGATT_SR_MSG* p_msg, Loading system/stack/test/gatt/mock_gatt_utils_ref.cc +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ bool background_connect_remove(uint8_t app_id, const RawAddress& address) { bool direct_connect_remove(uint8_t app_id, const RawAddress& address) { return false; } bool is_background_connection(const RawAddress& address) { return false; } } // namespace connection_manager /** stack/gatt/att_protocol.cc */ Loading Loading
system/stack/gatt/connection_manager.cc +8 −2 Original line number Diff line number Diff line Loading @@ -397,6 +397,10 @@ bool background_connect_remove(uint8_t app_id, const RawAddress& address) { return true; } bool is_background_connection(const RawAddress& address) { return bgconn_dev.find(address) != bgconn_dev.end(); } /** deregister all related background connetion device. */ void on_app_deregistered(uint8_t app_id) { LOG_DEBUG("app_id=%d", static_cast<int>(app_id)); Loading Loading @@ -528,13 +532,15 @@ bool direct_connect_remove(uint8_t app_id, const RawAddress& address) { ADDRESS_TO_LOGGABLE_CSTR(address)); auto it = bgconn_dev.find(address); if (it == bgconn_dev.end()) { LOG_WARN("Unable to find background connection to remove"); LOG_WARN("Unable to find background connection to remove peer:%s", ADDRESS_TO_LOGGABLE_CSTR(address)); return false; } auto app_it = it->second.doing_direct_conn.find(app_id); if (app_it == it->second.doing_direct_conn.end()) { LOG_WARN("Unable to find direct connection to remove"); LOG_WARN("Unable to find direct connection to remove peer:%s", ADDRESS_TO_LOGGABLE_CSTR(address)); return false; } Loading
system/stack/gatt/connection_manager.h +2 −0 Original line number Diff line number Diff line Loading @@ -61,4 +61,6 @@ extern void dump(int fd); extern void on_connection_timed_out(uint8_t app_id, const RawAddress& address); extern void on_connection_timed_out_from_shim(const RawAddress& address); extern bool is_background_connection(const RawAddress& address); } // namespace connection_manager
system/stack/gatt/gatt_utils.cc +12 −5 Original line number Diff line number Diff line Loading @@ -1468,11 +1468,18 @@ bool gatt_cancel_open(tGATT_IF gatt_if, const RawAddress& bda) { } if (!connection_manager::direct_connect_remove(gatt_if, bda)) { if (!connection_manager::is_background_connection(bda)) { BTM_AcceptlistRemove(bda); LOG_INFO( "GATT connection manager has no record but removed filter acceptlist " "gatt_if:%hhu peer:%s", "Gatt connection manager has no background record but " " removed filter acceptlist gatt_if:%hhu peer:%s", gatt_if, ADDRESS_TO_LOGGABLE_CSTR(bda)); } else { LOG_INFO( "Gatt connection manager maintains a background record" " preserving filter acceptlist gatt_if:%hhu peer:%s", gatt_if, ADDRESS_TO_LOGGABLE_CSTR(bda)); } } return true; } Loading
system/stack/test/gatt/gatt_sr_test.cc +2 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ bool background_connect_remove(uint8_t app_id, const RawAddress& address) { bool direct_connect_remove(uint8_t app_id, const RawAddress& address) { return false; } bool is_background_connection(const RawAddress& address) { return false; } } // namespace connection_manager BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, tGATT_SR_MSG* p_msg, Loading
system/stack/test/gatt/mock_gatt_utils_ref.cc +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ bool background_connect_remove(uint8_t app_id, const RawAddress& address) { bool direct_connect_remove(uint8_t app_id, const RawAddress& address) { return false; } bool is_background_connection(const RawAddress& address) { return false; } } // namespace connection_manager /** stack/gatt/att_protocol.cc */ Loading