Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5e7580c authored by Android Build Merger (Role)'s avatar Android Build Merger (Role)
Browse files

[automerger] DO NOT MERGE Fix for Bluetooth connection being dropped after HCI...

[automerger] DO NOT MERGE Fix for Bluetooth connection being dropped after HCI Read Encryption Key Size am: 5ddb1de2 am: 03bf5b82 am: 8377c6ba am: 2623bcc3

Change-Id: I462281e1e328875bff50defc951aa436245740da
parents dcb48026 2623bcc3
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -607,6 +607,15 @@ bool read_key_send_from_key_refresh = false;

static void read_encryption_key_size_complete_after_key_refresh(
    uint8_t status, uint16_t handle, uint8_t key_size) {
  if (status == HCI_ERR_INSUFFCIENT_SECURITY) {
    /* If remote device stop the encryption before we call "Read Encryption Key
     * Size", we might receive Insufficient Security, which means that link is
     * no longer encrypted. */
    HCI_TRACE_WARNING("%s encryption stopped on link: 0x%02x", __func__,
                      handle);
    return;
  }

  if (status != HCI_SUCCESS) {
    HCI_TRACE_WARNING("%s: disconnecting, status: 0x%02x", __func__, status);
    btsnd_hcic_disconnect(handle, HCI_ERR_PEER_USER);
@@ -629,6 +638,15 @@ static void read_encryption_key_size_complete_after_key_refresh(

static void read_encryption_key_size_complete_after_encryption_change(
    uint8_t status, uint16_t handle, uint8_t key_size) {
  if (status == HCI_ERR_INSUFFCIENT_SECURITY) {
    /* If remote device stop the encryption before we call "Read Encryption Key
     * Size", we might receive Insufficient Security, which means that link is
     * no longer encrypted. */
    HCI_TRACE_WARNING("%s encryption stopped on link: 0x%02x", __func__,
                      handle);
    return;
  }

  if (status != HCI_SUCCESS) {
    HCI_TRACE_WARNING("%s: disconnecting, status: 0x%02x", __func__, status);
    btsnd_hcic_disconnect(handle, HCI_ERR_PEER_USER);