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:31 +08:00
parent 689b165fc6
commit 3d9da8a2bd

View File

@@ -368,6 +368,12 @@ tBTM_SEC_DEV_REC *btm_sec_alloc_dev (BD_ADDR bd_addr)
}
if (!new_entry_found) {
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 {
/* if the old device entry not present go with new entry */
if (old_entry_found) {