This inverts previous conditions which attempt to limit what error
conditions cause link key deletion and instead of excluding error codes
it provides a shorter list of codes which actually DO cause link key
deletion.
As a result, temporary failures caused by page timeouts, random
disconnects etc. should no longer cause link key deletion by accident.
Fixes:
63507123
Test: manual
Change-Id: I8d51403b8d233a3c335313b8f257a562c3d01109
(cherry picked from commit
51fb9c0e0cfbda559bf6377c183928ae48a24629)
if (bta_dm_cb.p_sec_cback)
bta_dm_cb.p_sec_cback(BTA_DM_AUTH_CMPL_EVT, &sec_event);
- if (result != HCI_ERR_LMP_RESPONSE_TIMEOUT &&
- result != HCI_ERR_PAGE_TIMEOUT && result != HCI_ERR_CONNECTION_TOUT &&
- result != HCI_ERR_CONN_FAILED_ESTABLISHMENT &&
- result != HCI_ERR_KEY_MISSING) {
+ if (result == HCI_ERR_AUTH_FAILURE || result == HCI_ERR_KEY_MISSING ||
+ result == HCI_ERR_HOST_REJECT_SECURITY ||
+ result == HCI_ERR_ENCRY_MODE_NOT_ACCEPTABLE) {
bdstr_t bd_addr_str;
APPL_TRACE_WARNING("%s deleting %s - result: 0x%02x", __func__,
bdaddr_to_string((bt_bdaddr_t*)bd_addr, bd_addr_str,