#define LOG_TAG "bt_bta_dm"
+#include <base/logging.h>
+
#include <cstdint>
#include "bta/dm/bta_dm_int.h"
#include "bta/gatt/bta_gattc_int.h"
#include "bta/include/bta_dm_ci.h"
+#include "btif/include/btif_config.h"
#include "btif/include/btif_dm.h"
#include "btif/include/btif_storage.h"
#include "btif/include/stack_manager.h"
#include "osi/include/fixed_queue.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"
+#include "stack/btm/btm_ble_int.h"
#include "stack/btm/btm_sec.h"
#include "stack/btm/neighbor_inquiry.h"
#include "stack/gatt/connection_manager.h"
if (!other_address_connected && !other_address.IsEmpty()) {
bta_dm_process_remove_device(other_address);
}
+
+ /* Check the length of the paired devices, and if 0 then reset IRK */
+ auto paired_devices = btif_config_get_paired_devices();
+ if (paired_devices.empty()) {
+ LOG_INFO("Last paired device removed, resetting IRK");
+ btm_ble_reset_id();
+ }
}
/*******************************************************************************