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

Commit 551d63c4 authored by Brian Delwiche's avatar Brian Delwiche Committed by Android (Google) Code Review
Browse files

Merge "Encrypt LE link immediately on reconnection" into udc-dev

parents 7d90c994 e5e338af
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1140,6 +1140,17 @@ void StackAclBtmAcl::btm_establish_continue(tACL_CONN* p_acl) {
                ADDRESS_TO_LOGGABLE_CSTR(p_acl->RemoteAddress()));
    }
    btm_set_link_policy(p_acl, btm_cb.acl_cb_.DefaultLinkPolicy());
  } else if (p_acl->is_transport_ble()) {
    tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(p_acl->remote_addr);

    if (p_dev_rec == nullptr) {
      LOG_WARN("No security record for %s",
               ADDRESS_TO_LOGGABLE_CSTR(p_acl->RemoteAddress()));
    } else if (p_dev_rec->is_le_link_key_known()) {
      btm_ble_set_encryption(
          p_acl->remote_addr, BTM_BLE_SEC_ENCRYPT,
          p_dev_rec->role_central ? HCI_ROLE_CENTRAL : HCI_ROLE_PERIPHERAL);
    }
  }
  NotifyAclLinkUp(*p_acl);
}