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

Commit 637051a6 authored by Chris Manton's avatar Chris Manton
Browse files

Properly retrieve acl_conn stack/acl/btm_acl::btm_pm_proc_mode_change

Towards encapsulation

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

Change-Id: I65399f4e4bc108c19e1e52dcd719f050f7479caa
parent fa0a96ed
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -680,8 +680,6 @@ void btm_pm_proc_cmd_status(uint8_t status) {
void btm_pm_proc_mode_change(uint8_t hci_status, uint16_t hci_handle,
                             tHCI_MODE hci_mode, uint16_t interval) {
  tBTM_PM_STATUS mode = static_cast<tBTM_PM_STATUS>(hci_mode);

  tBTM_PM_MCB* p_cb = NULL;
  int xx, yy, zz;
  tBTM_PM_STATE old_state;

@@ -692,7 +690,13 @@ void btm_pm_proc_mode_change(uint8_t hci_status, uint16_t hci_handle,
  const RawAddress bd_addr = acl_address_from_handle(hci_handle);

  /* update control block */
  p_cb = &(btm_cb.acl_cb_.pm_mode_db[xx]);
  tBTM_PM_MCB* p_cb =
      internal_.btm_pm_get_power_manager_from_handle(hci_handle);
  if (p_cb == nullptr) {
    LOG_WARN("Unable to find active acl");
    return;
  }

  old_state = p_cb->state;
  p_cb->state = mode;
  p_cb->interval = interval;