summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
author Himanshu Rawat <rwt@google.com> 2025-03-17 10:54:13 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2025-03-17 10:54:13 -0700
commit99ed9afd2ddbe2069a82f81f5223ef1d575c8f66 (patch)
treec192cf0e8c6016ba868aa05e0cc5dc3154985ac3 /system
parent08016aaa64c9e9eff11878ae26ab3bbc7d7a1955 (diff)
parentc9229a52785734f1343c16f41abe1b95d3d1719f (diff)
Merge "Don't remove bond on encryption failure in peripheral role" into main
Diffstat (limited to 'system')
-rw-r--r--system/stack/btm/btm_ble_sec.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/system/stack/btm/btm_ble_sec.cc b/system/stack/btm/btm_ble_sec.cc
index cef553c79e..b8e2002c60 100644
--- a/system/stack/btm/btm_ble_sec.cc
+++ b/system/stack/btm/btm_ble_sec.cc
@@ -1662,6 +1662,13 @@ static bool btm_ble_complete_evt_ignore(const tBTM_SEC_DEV_REC* p_dev_rec,
p_dev_rec->bd_addr);
l2cu_start_post_bond_timer(p_dev_rec->ble_hci_handle);
return true;
+ } else if (com::android::bluetooth::flags::le_peripheral_enc_failure() &&
+ !p_dev_rec->role_central) {
+ log::warn("Peripheral encryption request failed for the bonded device {} with reason {}",
+ p_dev_rec->bd_addr, smp_status_text(p_data->complt.reason));
+ btm_sec_disconnect(p_dev_rec->ble_hci_handle, HCI_ERR_AUTH_FAILURE,
+ smp_status_text(p_data->complt.reason));
+ return true;
}
}