system/bt
修訂 | cb880ad379f618f6f071fcf75fae2636d5c50a2c (tree) |
---|---|
時間 | 2019-06-06 23:32:29 |
作者 | Android Build Merger (Role) <noreply-android-build-merger@goog...> |
Commiter | Android Build Merger (Role) |
[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
@@ -607,6 +607,15 @@ bool read_key_send_from_key_refresh = false; | ||
607 | 607 | |
608 | 608 | static void read_encryption_key_size_complete_after_key_refresh( |
609 | 609 | 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 | + | |
610 | 619 | if (status != HCI_SUCCESS) { |
611 | 620 | HCI_TRACE_WARNING("%s: disconnecting, status: 0x%02x", __func__, status); |
612 | 621 | btsnd_hcic_disconnect(handle, HCI_ERR_PEER_USER); |
@@ -629,6 +638,15 @@ static void read_encryption_key_size_complete_after_key_refresh( | ||
629 | 638 | |
630 | 639 | static void read_encryption_key_size_complete_after_encryption_change( |
631 | 640 | 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 | + | |
632 | 650 | if (status != HCI_SUCCESS) { |
633 | 651 | HCI_TRACE_WARNING("%s: disconnecting, status: 0x%02x", __func__, status); |
634 | 652 | btsnd_hcic_disconnect(handle, HCI_ERR_PEER_USER); |