Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4ed3520 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

call connection_manager::on_connection_complete from just one place

Currently, on_connection_complete is called from three different
locations. It's enough to call it from just one place.

on_connection_complete marks apps doing direct connection as no longer
interested in particular device. It should be called after TCB is
created, and interested apps are rewritten to gatt control blocks.
Therefore, just the latest call in chain is left, in gatt_send_conn_cback.

This is needed for next patch in chain, which is removing the doubled
list of registrations from GATT.

Test: atest avatar:'LeHostTest#test_disconnect' -v
Bug: 372202918
Flag: EXEMPT, removing redundant code
Change-Id: Ibd2ff062dc26df7c2c2a627328d97e2e9da3551d
parent 93b14b38
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -50,9 +50,6 @@ static bool acl_ble_common_connection(const tBLE_BD_ADDR& address_with_type, uin
    btm_ble_clear_topology_mask(BTM_BLE_STATE_INIT_BIT);
  }

  // Inform any applications that a connection has completed.
  connection_manager::on_connection_complete(address_with_type.bda);

  // Allocate or update the security device record for this device
  btm_ble_connected(address_with_type.bda, handle, HCI_ENCRYPT_MODE_DISABLED, role,
                    address_with_type.type, is_in_security_db,
@@ -108,8 +105,6 @@ void acl_ble_enhanced_connection_complete_from_shim(
        uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout,
        const RawAddress& local_rpa, const RawAddress& peer_rpa, tBLE_ADDR_TYPE peer_addr_type,
        bool can_read_discoverable_characteristics) {
  connection_manager::on_connection_complete(address_with_type.bda);

  tBLE_BD_ADDR resolved_address_with_type;
  const bool is_in_security_db =
          maybe_resolve_received_address(address_with_type, &resolved_address_with_type);