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

This commit is contained in:
zhanghaipeng
2025-07-22 21:20:17 +08:00
parent 48235c7b25
commit 61606a6f95

View File

@@ -368,6 +368,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) {