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

Commit 009099dc authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Get real transport for BT_TRANSPORT_AUTO when remove bond"

parents d2da3e10 1b8ec729
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -633,6 +633,15 @@ void bta_dm_remove_device(const RawAddress& bd_addr) {
  if (other_address == bd_addr) other_address = other_address2;

  if (other_address_connected) {
    // Get real transport
    if (other_transport == BT_TRANSPORT_AUTO) {
      bool connected_with_br_edr =
          BTM_IsAclConnectionUp(other_address, BT_TRANSPORT_BR_EDR);
      other_transport =
          connected_with_br_edr ? BT_TRANSPORT_BR_EDR : BT_TRANSPORT_LE;
    }
    LOG_INFO("other_address %s with transport %d connected",
             PRIVATE_ADDRESS(other_address), other_transport);
    /* Take the link down first, and mark the device for removal when
     * disconnected */
    for (int i = 0; i < bta_dm_cb.device_list.count; i++) {
@@ -640,6 +649,7 @@ void bta_dm_remove_device(const RawAddress& bd_addr) {
      if (peer_device.peer_bdaddr == other_address &&
          peer_device.transport == other_transport) {
        peer_device.conn_state = BTA_DM_UNPAIRING;
        LOG_INFO("Remove ACL of address %s", PRIVATE_ADDRESS(other_address));

        /* Make sure device is not in acceptlist before we disconnect */
        GATT_CancelConnect(0, bd_addr, false);