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

Commit 0d99da99 authored by Chris Manton's avatar Chris Manton
Browse files

Use new API stack/btm/btm_sec

acl_get_connection_from_handle

Working towards encapsulation of tACL_CONN

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ia89011aa6129e188d5a6b6562f369d0a699b6bd0
parent 2973959c
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -3584,14 +3584,12 @@ void btm_sec_encrypt_change(uint16_t handle, uint8_t status,
  BTM_TRACE_DEBUG("after update p_dev_rec->sec_flags=0x%x",
                  p_dev_rec->sec_flags);

  uint8_t acl_idx = btm_handle_to_acl_index(handle);
  tACL_CONN* p_acl = NULL;
  if (acl_idx != MAX_L2CAP_LINKS) p_acl = &btm_cb.acl_cb_.acl_db[acl_idx];

  if (p_acl != NULL)
  if (BTM_IsAclConnectionUpFromHandle(handle)) {
    btm_sec_check_pending_enc_req(p_dev_rec, p_acl->transport, encr_enable);
  }

  if (p_acl && p_acl->transport == BT_TRANSPORT_LE) {
  if (BTM_IsAclConnectionUpFromHandle(handle) &&
      acl_is_transport_le_from_handle(handle)) {
    if (status == HCI_ERR_KEY_MISSING || status == HCI_ERR_AUTH_FAILURE ||
        status == HCI_ERR_ENCRY_MODE_NOT_ACCEPTABLE) {
      p_dev_rec->sec_flags &= ~(BTM_SEC_LE_LINK_KEY_KNOWN);