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

Commit 2bf01b29 authored by Zach Johnson's avatar Zach Johnson
Browse files

Simplify BTM_RegBusyLevelNotif

return value was not used, only called in one place, level notification
was never used either

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I370ad2c3e019c1549fdf11ce5f3028ff1c1ea541
parent e164f5e7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -426,7 +426,7 @@ static void bta_dm_sys_hw_cback(tBTA_SYS_HW_EVT status) {
    BTM_WritePageTimeout(p_bta_dm_cfg->page_timeout);
    bta_dm_cb.cur_policy = p_bta_dm_cfg->policy_settings;
    BTM_SetDefaultLinkPolicy(bta_dm_cb.cur_policy);
    BTM_RegBusyLevelNotif(bta_dm_bl_change_cback, NULL,
    BTM_RegBusyLevelNotif(bta_dm_bl_change_cback,
                          BTM_BL_UPDATE_MASK | BTM_BL_ROLE_CHG_MASK);

#if (BLE_VND_INCLUDED == TRUE)
+2 −4
Original line number Diff line number Diff line
@@ -1317,10 +1317,8 @@ tBTM_STATUS BTM_ReadTxPower(const RawAddress& remote_bda,
 * Description      This function is called to register a callback to receive
 *                  busy level change events.
 *
 * Returns          BTM_SUCCESS if successfully registered, otherwise error
 *
 ******************************************************************************/
tBTM_STATUS BTM_RegBusyLevelNotif(tBTM_BL_CHANGE_CB* p_cb, uint8_t* p_level,
void BTM_RegBusyLevelNotif(tBTM_BL_CHANGE_CB* p_cb,
                           tBTM_BL_EVENT_MASK evt_mask);

/*******************************************************************************
+3 −15
Original line number Diff line number Diff line
@@ -1732,24 +1732,12 @@ uint8_t* BTM_ReadRemoteFeatures(const RawAddress& addr) {
 * Description      This function is called to register a callback to receive
 *                  busy level change events.
 *
 * Returns          BTM_SUCCESS if successfully registered, otherwise error
 *
 ******************************************************************************/
tBTM_STATUS BTM_RegBusyLevelNotif(tBTM_BL_CHANGE_CB* p_cb, uint8_t* p_level,
void BTM_RegBusyLevelNotif(tBTM_BL_CHANGE_CB* p_cb,
                           tBTM_BL_EVENT_MASK evt_mask) {
  BTM_TRACE_DEBUG("BTM_RegBusyLevelNotif");
  if (p_level) *p_level = btm_cb.busy_level;

  btm_cb.acl_cb_.bl_evt_mask = evt_mask;

  if (!p_cb)
    btm_cb.acl_cb_.p_bl_changed_cb = NULL;
  else if (btm_cb.acl_cb_.p_bl_changed_cb)
    return (BTM_BUSY);
  else
  btm_cb.acl_cb_.p_bl_changed_cb = p_cb;

  return (BTM_SUCCESS);
}

/*******************************************************************************
+2 −4
Original line number Diff line number Diff line
@@ -32,10 +32,8 @@
 * Description      This function is called to register a callback to receive
 *                  busy level change events.
 *
 * Returns          BTM_SUCCESS if successfully registered, otherwise error
 *
 ******************************************************************************/
tBTM_STATUS BTM_RegBusyLevelNotif(tBTM_BL_CHANGE_CB* p_cb, uint8_t* p_level,
void BTM_RegBusyLevelNotif(tBTM_BL_CHANGE_CB* p_cb,
                           tBTM_BL_EVENT_MASK evt_mask);

/*****************************************************************************