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

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

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

parents 24508a81 92f3a12b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1079,6 +1079,17 @@ void StackAclBtmAcl::btm_establish_continue(tACL_CONN* p_acl) {
                PRIVATE_ADDRESS(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",
               PRIVATE_ADDRESS(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);
}