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

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

Merge "Do not ignore timeout for bonding devices" into main

parents a9482301 0ff5f570
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -3375,16 +3375,20 @@ static void btif_dm_ble_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) {
        break;

      case BTA_DM_AUTH_SMP_CONN_TOUT: {
        if (!p_auth_cmpl->is_ctkd && btm_sec_is_a_bonded_dev(bd_addr)) {
        bool during_bonding =
                (bd_addr == pairing_cb.bd_addr || bd_addr == pairing_cb.static_bdaddr);

        if (during_bonding || p_auth_cmpl->is_ctkd || !btm_sec_is_a_bonded_dev(bd_addr)) {
          log::info("Removing ble bonding keys on SMP_CONN_TOUT during_bonding: {}, is_ctkd: {}",
                    during_bonding, p_auth_cmpl->is_ctkd);
          btif_dm_remove_ble_bonding_keys();
          status = BT_STATUS_AUTH_FAILURE;
        } else {
          log::warn("Bonded device addr={}, timed out - will not remove the keys", bd_addr);
          // Don't send state change to upper layers - otherwise Java think we
          // unbonded, and will disconnect HID profile.
          return;
        }
        log::info("Removing ble bonding keys on SMP_CONN_TOUT during crosskey: {}",
                  p_auth_cmpl->is_ctkd);
        btif_dm_remove_ble_bonding_keys();
        status = BT_STATUS_AUTH_FAILURE;
        break;
      }
      case BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT: