From 7a8ab6a42900412a65fbb2a8534de3d1aa8e00ee Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Sun, 10 Jan 2021 14:51:01 -0800 Subject: [PATCH] Use stack/acl/btm_acl::on_acl_br_edr_{success,failed} Try not to re-converge divergent code paths Bug: 163134718 Tag: #refactor Test: compile & verify basic functions working Change-Id: I9f3abe06f0ee276af583fbcb715f198710f48fec --- stack/acl/btm_acl.cc | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/stack/acl/btm_acl.cc b/stack/acl/btm_acl.cc index 3e39dff54..a0e13b6e9 100644 --- a/stack/acl/btm_acl.cc +++ b/stack/acl/btm_acl.cc @@ -2729,23 +2729,11 @@ void on_acl_br_edr_failed(const RawAddress& bda, tHCI_STATUS status) { void btm_acl_connected(const RawAddress& bda, uint16_t handle, tHCI_STATUS status, uint8_t enc_mode) { - btm_sec_connected(bda, handle, status, enc_mode); - btm_acl_set_paging(false); - l2c_link_hci_conn_comp(status, handle, bda); - - /* - * The legacy code path informs the upper layer via the BTA - * layer after all relevant read_remote_ commands are complete. - * The GD code path has ownership of the read_remote_ commands - * and thus may inform the upper layers about the connection. - */ - if (bluetooth::shim::is_gd_acl_enabled()) { - tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(handle); - if (p_acl != nullptr) { - NotifyAclLinkUp(*p_acl); - } else { - LOG_WARN("Unable to find active acl"); - } + switch (status) { + case HCI_SUCCESS: + return on_acl_br_edr_connected(bda, handle, enc_mode); + default: + return on_acl_br_edr_failed(bda, status); } } -- 2.11.0