• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


Commit MetaInfo

修訂cb880ad379f618f6f071fcf75fae2636d5c50a2c (tree)
時間2019-06-06 23:32:29
作者Android Build Merger (Role) <noreply-android-build-merger@goog...>
CommiterAndroid Build Merger (Role)

Log Message

[automerger] DO NOT MERGE Fix for Bluetooth connection being dropped after HCI Read Encryption Key Size am: c5aa5feebf am: 0a76ef0245 am: 20649305ba am: 20f1cf2b81

Change-Id: I462281e1e328875bff50defc951aa436245740da

Change Summary

差異

--- a/stack/btu/btu_hcif.c
+++ b/stack/btu/btu_hcif.c
@@ -607,6 +607,15 @@ bool read_key_send_from_key_refresh = false;
607607
608608 static void read_encryption_key_size_complete_after_key_refresh(
609609 uint8_t status, uint16_t handle, uint8_t key_size) {
610+ if (status == HCI_ERR_INSUFFCIENT_SECURITY) {
611+ /* If remote device stop the encryption before we call "Read Encryption Key
612+ * Size", we might receive Insufficient Security, which means that link is
613+ * no longer encrypted. */
614+ HCI_TRACE_WARNING("%s encryption stopped on link: 0x%02x", __func__,
615+ handle);
616+ return;
617+ }
618+
610619 if (status != HCI_SUCCESS) {
611620 HCI_TRACE_WARNING("%s: disconnecting, status: 0x%02x", __func__, status);
612621 btsnd_hcic_disconnect(handle, HCI_ERR_PEER_USER);
@@ -629,6 +638,15 @@ static void read_encryption_key_size_complete_after_key_refresh(
629638
630639 static void read_encryption_key_size_complete_after_encryption_change(
631640 uint8_t status, uint16_t handle, uint8_t key_size) {
641+ if (status == HCI_ERR_INSUFFCIENT_SECURITY) {
642+ /* If remote device stop the encryption before we call "Read Encryption Key
643+ * Size", we might receive Insufficient Security, which means that link is
644+ * no longer encrypted. */
645+ HCI_TRACE_WARNING("%s encryption stopped on link: 0x%02x", __func__,
646+ handle);
647+ return;
648+ }
649+
632650 if (status != HCI_SUCCESS) {
633651 HCI_TRACE_WARNING("%s: disconnecting, status: 0x%02x", __func__, status);
634652 btsnd_hcic_disconnect(handle, HCI_ERR_PEER_USER);