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

Commit 17eba99c authored by bidsharma's avatar bidsharma
Browse files

Delete keys if SMP over BR fails

BluetoothBondStateMachine is stuck in pending command state if SMP over
BR fails. This is because the stack incorrectly thinks this is a HID
device and does not remove the incomplete keys which inturn avoids
bta_dm from sending a callback to BondStateMachine.

Bug: 222409893
Test: gd/cert/run
Tag: #refactor

Change-Id: I0a5df3829644d58a972673bb4b00bb2684c74577
(cherry picked from commit a800f32f)
parent 199e76a5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3620,7 +3620,8 @@ static uint8_t bta_dm_ble_smp_cback(tBTM_LE_EVT event, const RawAddress& bda,
                (static_cast<uint8_t>(p_data->complt.reason))));

        if (btm_sec_is_a_bonded_dev(bda) &&
            p_data->complt.reason == SMP_CONN_TOUT) {
            p_data->complt.reason == SMP_CONN_TOUT &&
            !p_data->complt.smp_over_br) {
          // Bonded device failed to encrypt - to test this remove battery from
          // HID device right after connection, but before encryption is
          // established