fix(ble/bluedroid): ensure resolving list is updated when the oldest device is removed

(cherry picked from commit 61606a6f95)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
This commit is contained in:
Zhang Hai Peng
2025-07-25 21:53:18 +08:00
parent 59de68ee84
commit 3ebd5ad0fc

View File

@@ -367,6 +367,12 @@ tBTM_SEC_DEV_REC *btm_sec_alloc_dev (BD_ADDR bd_addr)
} }
if (!new_entry_found) { if (!new_entry_found) {
p_dev_rec = btm_find_oldest_dev(); p_dev_rec = btm_find_oldest_dev();
#if (BLE_INCLUDED == TRUE) && (SMP_INCLUDED == TRUE)
// If device record exists and contains identity key, remove it from resolving list
if (p_dev_rec && (p_dev_rec->ble.key_type & SMP_SEC_KEY_TYPE_ID)) {
btm_ble_resolving_list_remove_dev(p_dev_rec);
}
#endif // (BLE_INCLUDED == TRUE) && (SMP_INCLUDED == TRUE)
} else { } else {
/* if the old device entry not present go with new entry */ /* if the old device entry not present go with new entry */
if (old_entry_found) { if (old_entry_found) {