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

Commit d7feb1df authored by William Escande's avatar William Escande
Browse files

Remove second action on tBTA_DM_PM_SPEC

Action was never used

Test: atest bt_host_test_bta
Bug: 263323082
Change-Id: Ieee5a2d594319c92d38be0423d8f00a80ce77420
parent b06269c1
Loading
Loading
Loading
Loading
+140 −271

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@ typedef struct {
typedef struct {
  uint8_t allow_mask; /* mask of sniff/hold/park modes to allow */
  uint8_t ssr; /* set SSR on conn open/unpark */
  tBTA_DM_PM_ACTN actn_tbl[BTA_DM_PM_NUM_EVTS][2];
  tBTA_DM_PM_ACTN actn_tbl[BTA_DM_PM_NUM_EVTS];

} tBTA_DM_PM_SPEC;

+3 −14
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id,

  /* if no action for the event */
  if (get_bta_dm_pm_spec()[p_bta_dm_pm_cfg[i].spec_idx]
          .actn_tbl[status][0]
          .actn_tbl[status]
          .power_mode == BTA_DM_PM_NO_ACTION) {
    if (BTA_DM_PM_SSR0 == index) /* and do not need to set SSR, return. */
      return;
@@ -412,7 +412,7 @@ static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id,
  /* if subsystem has no more preference on the power mode remove
 the cb */
  if (get_bta_dm_pm_spec()[p_bta_dm_pm_cfg[i].spec_idx]
          .actn_tbl[status][0]
          .actn_tbl[status]
          .power_mode == BTA_DM_PM_NO_PREF) {
    if (j != bta_dm_conn_srvcs.count) {
      bta_dm_conn_srvcs.count--;
@@ -515,7 +515,6 @@ static void bta_dm_pm_set_mode(const RawAddress& peer_addr,
  const tBTA_DM_PM_CFG* p_pm_cfg;
  const tBTA_DM_PM_SPEC* p_pm_spec;
  const tBTA_DM_PM_ACTN* p_act0;
  const tBTA_DM_PM_ACTN* p_act1;
  tBTA_DM_SRVCS* p_srvcs = NULL;
  bool timer_started = false;
  uint8_t timer_idx, available_timer = BTA_DM_PM_MODE_TIMER_MAX;
@@ -549,8 +548,7 @@ static void bta_dm_pm_set_mode(const RawAddress& peer_addr,

      p_pm_cfg = &p_bta_dm_pm_cfg[j];
      p_pm_spec = &get_bta_dm_pm_spec()[p_pm_cfg->spec_idx];
      p_act0 = &p_pm_spec->actn_tbl[p_srvcs->state][0];
      p_act1 = &p_pm_spec->actn_tbl[p_srvcs->state][1];
      p_act0 = &p_pm_spec->actn_tbl[p_srvcs->state];

      allowed_modes |= p_pm_spec->allow_mask;
      LOG_DEBUG(
@@ -575,15 +573,6 @@ static void bta_dm_pm_set_mode(const RawAddress& peer_addr,
          }
        }
      }
      /* if first preference has already failed, try second preference */
      else if (!(failed_pm & p_act1->power_mode)) {
        pref_modes |= p_act1->power_mode;

        if (p_act1->power_mode > pm_action) {
          pm_action = p_act1->power_mode;
          timeout_ms = p_act1->timeout;
        }
      }
    }
  }