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

Commit 793c4329 authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge changes from topic "cherrypicker-L86900000958037311:N20600001326095833"...

Merge changes from topic "cherrypicker-L86900000958037311:N20600001326095833" into tm-qpr-dev am: 53bfe63f

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/20901525



Change-Id: I34f47e2b978e270730a03315b14bd0e8c20027e4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1d1372e9 53bfe63f
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
@@ -378,7 +378,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;
@@ -397,7 +397,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--;
@@ -500,7 +500,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;
@@ -534,8 +533,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(
@@ -560,15 +558,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;
        }
      }
    }
  }