aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2021-12-08 23:00:25 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-12-08 23:00:25 +0000
commite57a4afd4a50d7b3d4d54557291dc9ed52ecb2a6 (patch)
treeb16b6085a42c68b75bcbaef66b259792ec9fb5c0
parentbdbdee6dfdc51196659d0b4b4da4d3e01345107d (diff)
parent02e9ee37f861c8711f7a324b2bf94b864631c4e5 (diff)
downloadbt-e57a4afd4a50d7b3d4d54557291dc9ed52ecb2a6.tar.gz
Merge "Reset the IRK after all devices are unpaired" into rvc-dev am: 02e9ee37f8
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/16232311 Change-Id: Ib6398e338a11e456b8f2b60b4ab633c689efcd54
-rw-r--r--bta/dm/bta_dm_act.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/bta/dm/bta_dm_act.cc b/bta/dm/bta_dm_act.cc
index d1b260c19..3900594bf 100644
--- a/bta/dm/bta_dm_act.cc
+++ b/bta/dm/bta_dm_act.cc
@@ -39,6 +39,7 @@
#include "bta_dm_int.h"
#include "bta_sys.h"
#include "btif_storage.h"
+#include "btif_config.h"
#include "btm_api.h"
#include "btm_int.h"
#include "btu.h"
@@ -48,6 +49,7 @@
#include "osi/include/log.h"
#include "osi/include/osi.h"
#include "sdp_api.h"
+#include "stack/btm/btm_ble_int.h"
#include "stack/gatt/connection_manager.h"
#include "stack/include/gatt_api.h"
#include "utl.h"
@@ -705,6 +707,12 @@ void bta_dm_remove_device(const RawAddress& bd_addr) {
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 */
+ if (btif_storage_get_num_bonded_devices() < 1) {
+ LOG(INFO) << "Last paired device removed, resetting IRK";
+ btm_ble_reset_id();
+ }
}
/*******************************************************************************