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

Commit 7792254d authored by Zach Johnson's avatar Zach Johnson Committed by Automerger Merge Worker
Browse files

Simplify BTM_RegBusyLevelNotif am: 2bf01b29

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1393884

Change-Id: I160adf399a84ad55e81b6fa26d8805f93805954b
parents 09cdaa01 2bf01b29
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);

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