Store BLE keys using the address from the ble_auth_cmpl_evt
am: 311ebcedb3
Change-Id: I6a6c61496b1f98618c22585681b147b3ce0d9740
diff --git a/btif/include/btif_dm.h b/btif/include/btif_dm.h
index a9cb228..a9d4cb6 100644
--- a/btif/include/btif_dm.h
+++ b/btif/include/btif_dm.h
@@ -100,7 +100,7 @@
void btif_dm_get_ble_local_keys(tBTA_DM_BLE_LOCAL_KEY_MASK* p_key_mask,
Octet16* p_er,
tBTA_BLE_LOCAL_ID_KEYS* p_id_keys);
-void btif_dm_save_ble_bonding_keys(void);
+void btif_dm_save_ble_bonding_keys(RawAddress& bd_addr);
void btif_dm_remove_ble_bonding_keys(void);
void btif_dm_ble_sec_req_evt(tBTA_DM_BLE_SEC_REQ* p_ble_req);
diff --git a/btif/src/btif_dm.cc b/btif/src/btif_dm.cc
index 1f5cb82..67a059e 100644
--- a/btif/src/btif_dm.cc
+++ b/btif/src/btif_dm.cc
@@ -2883,7 +2883,7 @@
btif_storage_remove_bonded_device(&bdaddr);
state = BT_BOND_STATE_NONE;
} else {
- btif_dm_save_ble_bonding_keys();
+ btif_dm_save_ble_bonding_keys(bdaddr);
btif_dm_get_remote_services_by_transport(&bd_addr, GATT_TRANSPORT_LE);
}
} else {
@@ -2964,11 +2964,9 @@
BTIF_TRACE_DEBUG("%s *p_key_mask=0x%02x", __func__, *p_key_mask);
}
-void btif_dm_save_ble_bonding_keys(void) {
+void btif_dm_save_ble_bonding_keys(RawAddress& bd_addr) {
BTIF_TRACE_DEBUG("%s", __func__);
- RawAddress bd_addr = pairing_cb.bd_addr;
-
if (pairing_cb.ble.is_penc_key_rcvd) {
btif_storage_add_ble_bonding_key(
&bd_addr, (uint8_t*)&pairing_cb.ble.penc_key, BTIF_DM_LE_KEY_PENC,