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

Commit dad778d1 authored by Jack He's avatar Jack He Committed by Automerger Merge Worker
Browse files

Merge "Remove timer when connection is cancelled" am: f08abaa8 am:...

Merge "Remove timer when connection is cancelled" am: f08abaa8 am: 42cb90cb am: aafbabec am: de1f5b71

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2159508



Change-Id: I04aaecc5420fa7ac972d0b75a3ba5baa171b9ecc
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b181a775 de1f5b71
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);
  }