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

Commit 4915177b authored by Chris Manton's avatar Chris Manton
Browse files

Add StackAclBtmPm::btm_pm_get_power_manager_from_address

Towards readable code

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

Change-Id: I99484639130e101db584866802564051ac9dd339
parent 02a09e04
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -50,7 +50,9 @@
struct StackAclBtmPm {
  tBTM_STATUS btm_pm_snd_md_req(uint8_t pm_id, int link_ind,
                                const tBTM_PM_PWR_MD* p_mode);
  tBTM_PM_MCB* btm_pm_get_power_manager_from_address(const RawAddress& bda);
};

namespace {
StackAclBtmPm internal_;
}
@@ -557,6 +559,13 @@ tBTM_STATUS StackAclBtmPm::btm_pm_snd_md_req(uint8_t pm_id, int link_ind,
  return BTM_CMD_STARTED;
}

tBTM_PM_MCB* StackAclBtmPm::btm_pm_get_power_manager_from_address(
    const RawAddress& bda) {
  int acl_index = btm_pm_find_acl_ind(bda);
  if (acl_index == MAX_L2CAP_LINKS) return nullptr;
  return &(btm_cb.acl_cb_.pm_mode_db[acl_index]);
}

/*******************************************************************************
 *
 * Function         btm_pm_proc_cmd_status