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

Commit 5e6bbde5 authored by Jakub Pawłowski's avatar Jakub Pawłowski Committed by Gerrit Code Review
Browse files

Merge "Rather than immediately removing classic device bond, send a broadcast" into main

parents a44419da b2269773
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -2427,6 +2427,20 @@ void btm_sec_rmt_host_support_feat_evt(const RawAddress bd_addr,
 ******************************************************************************/
void btm_io_capabilities_req(RawAddress p) {
  if (btm_sec_is_a_bonded_dev(p)) {
    if (com::android::bluetooth::flags::key_missing_classic_device()) {
      log::warn(
          "Incoming bond request, but {} is already bonded (notifying user)",
          p);
      bta_dm_remote_key_missing(p);

      auto p_dev_rec = btm_find_dev(p);
      if (p_dev_rec != NULL) {
        btm_sec_disconnect(p_dev_rec->hci_handle, HCI_ERR_AUTH_FAILURE,
                           "btm_io_capabilities_req Security failure");
      }
      return;
    }

    log::warn("Incoming bond request, but {} is already bonded (removing)", p);
    bta_dm_process_remove_device(p);
  }