fix(ble/bluedroid): Fixed issue with deleting link key when classic Bluetooth is not used

This commit is contained in:
zhanghaipeng
2025-04-09 21:26:50 +08:00
parent 7aabeaeab9
commit 7c16bce827
3 changed files with 5 additions and 1 deletions

View File

@ -187,8 +187,10 @@ BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr, tBT_TRANSPORT transport)
}
if ((p_dev_rec = btm_find_dev(bd_addr)) != NULL) {
#if (CLASSIC_BT_INCLUDED == TRUE)
/* Tell controller to get rid of the link key, if it has one stored */
BTM_DeleteStoredLinkKey (p_dev_rec->bd_addr, NULL);
#endif // (CLASSIC_BT_INCLUDED == TRUE)
btm_sec_free_dev(p_dev_rec, transport);
}

View File

@ -1149,6 +1149,7 @@ tBTM_STATUS BTM_EnableTestMode(void)
}
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
#if (CLASSIC_BT_INCLUDED == TRUE)
/*******************************************************************************
**
** Function BTM_DeleteStoredLinkKey
@ -1223,6 +1224,7 @@ void btm_delete_stored_link_key_complete (UINT8 *p)
}
}
#endif // (CLASSIC_BT_INCLUDED == TRUE)
/*******************************************************************************
**
** Function btm_report_device_status

View File

@ -1001,12 +1001,12 @@ tBTM_STATUS btm_sec_bond_by_transport (BD_ADDR bd_addr, tBT_TRANSPORT transport,
return (BTM_SUCCESS);
}
#if (CLASSIC_BT_INCLUDED == TRUE)
/* Tell controller to get rid of the link key if it has one stored */
if ((BTM_DeleteStoredLinkKey (bd_addr, NULL)) != BTM_SUCCESS) {
return (BTM_NO_RESOURCES);
}
#if (CLASSIC_BT_INCLUDED == TRUE)
/* Save the PIN code if we got a valid one */
if (p_pin && (pin_len <= PIN_CODE_LEN) && (pin_len != 0)) {
btm_cb.pin_code_len = pin_len;