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

Commit 26762616 authored by Chris Manton's avatar Chris Manton
Browse files

Properly retrieve acl_conn stack/acl/btm_acl::btm_acl_encrypt_change

Towards encapsulation

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: I256932b85550c1c005c54879002f19ad10e25d3d
parent 41f5a724
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -590,15 +590,11 @@ tBTM_STATUS BTM_SwitchRoleToCentral(const RawAddress& remote_bd_addr) {
 ******************************************************************************/
void btm_acl_encrypt_change(uint16_t handle, uint8_t status,
                            uint8_t encr_enable) {
  tACL_CONN* p;
  uint8_t xx;

  xx = btm_handle_to_acl_index(handle);
  /* don't assume that we can never get a bad hci_handle */
  if (xx < MAX_L2CAP_LINKS)
    p = &btm_cb.acl_cb_.acl_db[xx];
  else
  tACL_CONN* p = internal_.acl_get_connection_from_handle(handle);
  if (p == nullptr) {
    LOG_WARN("Unable to find active acl");
    return;
  }

  p->is_encrypted = encr_enable;