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

Commit f08abaa8 authored by Jack He's avatar Jack He Committed by Gerrit Code Review
Browse files

Merge "Remove timer when connection is cancelled"

parents af8615ec be772073
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -647,7 +647,7 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
      return;
    }
    if (connect_list.empty()) {
      LOG_ERROR("Attempting to re-arm le connection state machine when filter accept list is empty");
      LOG_INFO("Ignored request to re-arm le connection state machine when filter accept list is empty");
      return;
    }
    AddressWithType empty(Address::kEmpty, AddressType::RANDOM_DEVICE_ADDRESS);
@@ -847,6 +847,11 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
  }

  void cancel_connect(AddressWithType address_with_type) {
    // Remove any alarms for this peer, if any
    if (create_connection_timeout_alarms_.find(address_with_type) != create_connection_timeout_alarms_.end()) {
      create_connection_timeout_alarms_.at(address_with_type).Cancel();
      create_connection_timeout_alarms_.erase(address_with_type);
    }
    // the connection will be canceled by LeAddressManager.OnPause()
    remove_device_from_connect_list(address_with_type);
  }