#define BTA_DM_SWITCH_DELAY_TIMER_MS 500
#endif
+static void bta_dm_reset_sec_dev_pending(BD_ADDR remote_bd_addr);
static void bta_dm_remove_sec_dev_entry(BD_ADDR remote_bd_addr);
static void bta_dm_observe_results_cb(tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir);
static void bta_dm_observe_cmpl_cb(void * p_result);
#endif
if(bta_dm_cb.p_sec_cback)
bta_dm_cb.p_sec_cback(event, &sec_event);
+
+ // Setting remove_dev_pending flag to FALSE, where it will avoid deleting the
+ // security device record when the ACL connection link goes down in case of
+ // reconnection.
+ if (bta_dm_cb.device_list.count)
+ bta_dm_reset_sec_dev_pending(p_auth_cmpl->bd_addr);
}
else
{
/*******************************************************************************
**
+** Function bta_dm_reset_sec_dev_pending
+**
+** Description Setting the remove device pending status to FALSE from
+** security device DB, when the link key notification
+** event comes.
+**
+** Returns void
+**
+*******************************************************************************/
+static void bta_dm_reset_sec_dev_pending(BD_ADDR remote_bd_addr)
+{
+ for (size_t i = 0; i < bta_dm_cb.device_list.count; i++)
+ {
+ if (bdcmp(bta_dm_cb.device_list.peer_device[i].peer_bdaddr, remote_bd_addr) == 0)
+ {
+ bta_dm_cb.device_list.peer_device[i].remove_dev_pending = FALSE;
+ return;
+ }
+ }
+}
+
+/*******************************************************************************
+**
** Function bta_dm_remove_sec_dev_entry
**
** Description Removes device entry from Security device DB if ACL connection with