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

Commit 1d8d17ab authored by Jinguang Dong's avatar Jinguang Dong Committed by liuchao
Browse files

Do not delete device record on HCI_ERR_KEY_MISSING



If an auth_complete event is received with HCI_ERR_KEY_MISSING, the
p_dev_rec->sm4 flag will be set to "BTM_SM4_UNKNOWN" in the
BTM_SecClearSecurityFlags() function. This will prevent the
BTM_SM4_RETRY procedure from being executed, which can cause
pairing failures.

To reproduce:
 1. Two Phones, A: Android O, B: Android N.
 2. Enable B in Bluetooth visable mode
 3. A start discovery and create pairing with B successfully
 4. B cancel pairing with A by remove A from pairing device
    list of B.
 5. A create paring with B again by touch paired device in A,
    this first step will be failed.

Bug: 62615213
Test: manual
Change-Id: I514ba2f4d0fd2621c11bd83aeec24b8c6c6d2d5a
Signed-off-by: default avatarYequan Song <songyequan@huawei.com>
parent 24eb1daf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2590,7 +2590,8 @@ static uint8_t bta_dm_authentication_complete_cback(

    if (result != HCI_ERR_LMP_RESPONSE_TIMEOUT &&
        result != HCI_ERR_PAGE_TIMEOUT &&
        result != HCI_ERR_CONN_FAILED_ESTABLISHMENT) {
        result != HCI_ERR_CONN_FAILED_ESTABLISHMENT &&
        result != HCI_ERR_KEY_MISSING) {
      bta_dm_remove_sec_dev_entry(bd_addr);
    }
  }