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

Commit c73bbcdb authored by bidsharmag's avatar bidsharmag
Browse files

Report SMP timeout during ctkd to java layer

When crosskey fails with SMP timeout and keys
for one of the transport is available, stack
will think the device is already bonded and
won't report the faiure to bond state change
callback. This causes the bond state machine
to be stuck.

Bug: 262336159
Tag: #refactor
Test: manual

Change-Id: Ib4019247844da210026fc65534899db30be34335
parent c63f8cec
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3384,7 +3384,7 @@ static void btif_dm_ble_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) {
        break;

      case BTA_DM_AUTH_SMP_CONN_TOUT: {
        if (btm_sec_is_a_bonded_dev(bd_addr)) {
        if (!p_auth_cmpl->is_ctkd && btm_sec_is_a_bonded_dev(bd_addr)) {
          LOG(INFO) << __func__ << " Bonded device addr="
                    << ADDRESS_TO_LOGGABLE_STR(bd_addr)
                    << " timed out - will not remove the keys";
@@ -3392,7 +3392,9 @@ static void btif_dm_ble_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) {
          // unbonded, and will disconnect HID profile.
          return;
        }

        LOG_INFO(
            "Removing ble bonding keys on SMP_CONN_TOUT during crosskey: %d",
            p_auth_cmpl->is_ctkd);
        btif_dm_remove_ble_bonding_keys();
        status = BT_STATUS_AUTH_FAILURE;
        break;