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

Commit 92e627ea authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

Conclude the LE encryption request immediately if already encrypted.

Some devices may not respond to the SMP Security request if the link is already encrypted. Non-response for SMP Security requests is treated as a pairing failure by SMP, resulting in bond removal.
This change reduces the probability of such issues.

Change-Id: Ib74f84bcc3965fee25b0ad86a1980aa0e08e9080
Test: mmm packages/modules/Bluetooth
Flag: EXEMPT bugfix
Bug: 384575786
parent 82bae21a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1143,6 +1143,10 @@ tBTM_STATUS btm_ble_set_encryption(const RawAddress& bd_addr, tBTM_BLE_SEC_ACT s

  switch (sec_act) {
    case BTM_BLE_SEC_ENCRYPT:
      if (p_rec->sec_rec.is_le_device_encrypted()) {
        return tBTM_STATUS::BTM_SUCCESS;
      }

      if (link_role == HCI_ROLE_CENTRAL) {
        /* start link layer encryption using the security info stored */
        cmd = btm_ble_start_encrypt(bd_addr, false, NULL);