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

Commit ac4ae392 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Inclusive Language Updates" am: a5ebd5b0

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

Change-Id: I3975580124676da55472a2a285cbf782fc62be3e
parents cc59bac5 a5ebd5b0
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -780,7 +780,7 @@ void bta_av_do_disc_a2dp(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
                        BTA_AV_AVRC_TIMER_EVT, p_scb->hndl);
  }

  if (bta_av_cb.features & BTA_AV_FEAT_MASTER) {
  if (bta_av_cb.features & BTA_AV_FEAT_CENTRAL) {
    BTM_default_block_role_switch();
  }
  /* store peer addr other parameters */
@@ -1793,11 +1793,11 @@ void bta_av_do_start(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
    return;
  }

  /* disallow role switch during streaming, only if we are the master role
  /* disallow role switch during streaming, only if we are the central role
   * i.e. allow role switch, if we are slave.
   * It would not hurt us, if the peer device wants us to be master */
   * It would not hurt us, if the peer device wants us to be central */
  if ((BTM_GetRole(p_scb->PeerAddress(), &cur_role) == BTM_SUCCESS) &&
      (cur_role == HCI_ROLE_MASTER)) {
      (cur_role == HCI_ROLE_CENTRAL)) {
    BTM_block_role_switch_for(p_scb->PeerAddress());
  }

@@ -1867,7 +1867,7 @@ void bta_av_str_stopped(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
      bta_av_cb.audio_open_cnt, p_data, start);

  bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->PeerAddress());
  if ((bta_av_cb.features & BTA_AV_FEAT_MASTER) == 0 ||
  if ((bta_av_cb.features & BTA_AV_FEAT_CENTRAL) == 0 ||
      bta_av_cb.audio_open_cnt == 1) {
    BTM_unblock_role_switch_for(p_scb->PeerAddress());
  }
@@ -2229,10 +2229,10 @@ void bta_av_start_ok(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
  if (!bta_av_link_role_ok(p_scb, A2DP_SET_ONE_BIT))
    p_scb->q_tag = BTA_AV_Q_TAG_START;
  else {
    /* The wait flag may be set here while we are already master on the link */
    /* The wait flag may be set here while we are already central on the link */
    /* this could happen if a role switch complete event occurred during
     * reconfig */
    /* if we are now master on the link, there is no need to wait for the role
    /* if we are now central on the link, there is no need to wait for the role
     * switch, */
    /* complete anymore so we can clear the wait for role switch flag */
    p_scb->wait &= ~BTA_AV_WAIT_ROLE_SW_BITS;
@@ -2291,12 +2291,12 @@ void bta_av_start_ok(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
  {
    /* If sink starts stream, disable sniff mode here */
    if (!initiator) {
      /* If souce is the master role, disable role switch during streaming.
      /* If souce is the central role, disable role switch during streaming.
       * Otherwise allow role switch, if source is slave.
       * Because it would not hurt source, if the peer device wants source to be
       * master */
       * central */
      if ((BTM_GetRole(p_scb->PeerAddress(), &cur_role) == BTM_SUCCESS) &&
          (cur_role == HCI_ROLE_MASTER)) {
          (cur_role == HCI_ROLE_CENTRAL)) {
        BTM_block_role_switch_for(p_scb->PeerAddress());
      }
    }
@@ -2382,7 +2382,7 @@ void bta_av_str_closed(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
      __func__, p_scb->PeerAddress().ToString().c_str(), p_scb->hndl,
      p_scb->open_status, p_scb->chnl, p_scb->co_started);

  if ((bta_av_cb.features & BTA_AV_FEAT_MASTER) == 0 ||
  if ((bta_av_cb.features & BTA_AV_FEAT_CENTRAL) == 0 ||
      bta_av_cb.audio_open_cnt == 1) {
    BTM_unblock_role_switch_for(p_scb->PeerAddress());
  }
@@ -2493,7 +2493,7 @@ void bta_av_suspend_cfm(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
  }

  bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->PeerAddress());
  if ((bta_av_cb.features & BTA_AV_FEAT_MASTER) == 0 ||
  if ((bta_av_cb.features & BTA_AV_FEAT_CENTRAL) == 0 ||
      bta_av_cb.audio_open_cnt == 1) {
    BTM_unblock_role_switch_for(p_scb->PeerAddress());
  }
+9 −9
Original line number Diff line number Diff line
@@ -949,7 +949,7 @@ static void bta_av_sco_chg_cback(tBTA_SYS_CONN_STATUS status, uint8_t id,
 ******************************************************************************/
bool bta_av_switch_if_needed(tBTA_AV_SCB* p_scb) {
  // TODO: A workaround for devices that are connected first, become
  // Master, and block follow-up role changes - b/72122792 .
  // Central, and block follow-up role changes - b/72122792 .
  return false;
#if 0
  uint8_t role;
@@ -967,11 +967,11 @@ bool bta_av_switch_if_needed(tBTA_AV_SCB* p_scb) {
      BTM_GetRole(p_scbi->PeerAddress(), &role);
      /* this channel is open - clear the role switch link policy for this link
       */
      if (HCI_ROLE_MASTER != role) {
        if (bta_av_cb.features & BTA_AV_FEAT_MASTER)
      if (HCI_ROLE_CENTRAL != role) {
        if (bta_av_cb.features & BTA_AV_FEAT_CENTRAL)
          BTM_block_role_switch_for(p_scbi->PeerAddress());
        if (BTM_CMD_STARTED !=
            BTM_SwitchRole(p_scbi->PeerAddress(), HCI_ROLE_MASTER)) {
            BTM_SwitchRole(p_scbi->PeerAddress(), HCI_ROLE_CENTRAL)) {
          /* can not switch role on SCBI
           * start the timer on SCB - because this function is ONLY called when
           * SCB gets API_OPEN */
@@ -1009,17 +1009,17 @@ bool bta_av_link_role_ok(tBTA_AV_SCB* p_scb, uint8_t bits) {
        "features:0x%x",
        __func__, p_scb->PeerAddress().ToString().c_str(), p_scb->hndl, role,
        bta_av_cb.conn_audio, bits, bta_av_cb.features);
    if (HCI_ROLE_MASTER != role &&
    if (HCI_ROLE_CENTRAL != role &&
        (A2DP_BitsSet(bta_av_cb.conn_audio) > bits ||
         (bta_av_cb.features & BTA_AV_FEAT_MASTER))) {
      if (bta_av_cb.features & BTA_AV_FEAT_MASTER)
         (bta_av_cb.features & BTA_AV_FEAT_CENTRAL))) {
      if (bta_av_cb.features & BTA_AV_FEAT_CENTRAL)
        BTM_block_role_switch_for(p_scb->PeerAddress());

      tBTM_STATUS status =
          BTM_SwitchRole(p_scb->PeerAddress(), HCI_ROLE_MASTER);
          BTM_SwitchRole(p_scb->PeerAddress(), HCI_ROLE_CENTRAL);
      if (status != BTM_CMD_STARTED) {
        /* can not switch role on SCB - start the timer on SCB */
        LOG_ERROR("%s: peer %s BTM_SwitchRole(HCI_ROLE_MASTER) error: %d",
        LOG_ERROR("%s: peer %s BTM_SwitchRole(HCI_ROLE_CENTRAL) error: %d",
                  __func__, p_scb->PeerAddress().ToString().c_str(), status);
      }
      if (status != BTM_MODE_UNSUPPORTED && status != BTM_DEV_BLACKLISTED) {
+11 −12
Original line number Diff line number Diff line
@@ -2202,11 +2202,11 @@ static void handle_role_change(const RawAddress& bd_addr, uint8_t new_role,
        hci_status == HCI_SUCCESS) {
      /* more than one connections and the AV connection is role switched
       * to slave
       * switch it back to master and remove the switch policy */
      BTM_SwitchRole(bd_addr, HCI_ROLE_MASTER);
       * switch it back to central and remove the switch policy */
      BTM_SwitchRole(bd_addr, HCI_ROLE_CENTRAL);
      need_policy_change = true;
    } else if (p_bta_dm_cfg->avoid_scatter && (new_role == HCI_ROLE_MASTER)) {
      /* if the link updated to be master include AV activities, remove
    } else if (p_bta_dm_cfg->avoid_scatter && (new_role == HCI_ROLE_CENTRAL)) {
      /* if the link updated to be central include AV activities, remove
       * the switch policy */
      need_policy_change = true;
    }
@@ -2217,7 +2217,7 @@ static void handle_role_change(const RawAddress& bd_addr, uint8_t new_role,
  } else {
    /* there's AV no activity on this link and role switch happened
     * check if AV is active
     * if so, make sure the AV link is master */
     * if so, make sure the AV link is central */
    bta_dm_check_av();
  }
  bta_sys_notify_role_chg(bd_addr, new_role, hci_status);
@@ -2374,7 +2374,7 @@ void BTA_dm_acl_down(const RawAddress bd_addr, tBT_TRANSPORT transport) {
 * Function         bta_dm_check_av
 *
 * Description      This function checks if AV is active
 *                  if yes, make sure the AV link is master
 *                  if yes, make sure the AV link is central
 *
 ******************************************************************************/
static void bta_dm_check_av() {
@@ -2389,9 +2389,9 @@ static void bta_dm_check_av() {
                         p_dev->info);
      if ((p_dev->conn_state == BTA_DM_CONNECTED) &&
          (p_dev->info & BTA_DM_DI_AV_ACTIVE)) {
        /* make master and take away the role switch policy */
        BTM_SwitchRole(p_dev->peer_bdaddr, HCI_ROLE_MASTER);
        /* else either already master or can not switch for some reasons */
        /* make central and take away the role switch policy */
        BTM_SwitchRole(p_dev->peer_bdaddr, HCI_ROLE_CENTRAL);
        /* else either already central or can not switch for some reasons */
        BTM_block_role_switch_for(p_dev->peer_bdaddr);
        break;
      }
@@ -2571,9 +2571,8 @@ static void bta_dm_adjust_roles(bool delay_role_switch) {
      if (bta_dm_cb.device_list.peer_device[i].conn_state == BTA_DM_CONNECTED &&
          bta_dm_cb.device_list.peer_device[i].transport ==
              BT_TRANSPORT_BR_EDR) {

        if ((bta_dm_cb.device_list.peer_device[i].pref_role ==
             BTA_MASTER_ROLE_ONLY) ||
             BTA_CENTRAL_ROLE_ONLY) ||
            (br_count > 1)) {
          /* Initiating immediate role switch with certain remote devices
            has caused issues due to role  switch colliding with link encryption
@@ -2588,7 +2587,7 @@ static void bta_dm_adjust_roles(bool delay_role_switch) {
                  BTA_SLAVE_ROLE_ONLY &&
              !delay_role_switch) {
            BTM_SwitchRole(bta_dm_cb.device_list.peer_device[i].peer_bdaddr,
                           HCI_ROLE_MASTER);
                           HCI_ROLE_CENTRAL);
          } else {
            alarm_set_on_mloop(bta_dm_cb.switch_delay_timer,
                               BTA_DM_SWITCH_DELAY_TIMER_MS,
+6 −6
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@
#define BTA_DM_LINK_TIMEOUT 8000
#endif

/* TRUE to avoid scatternet when av is streaming (be the master) */
/* TRUE to avoid scatternet when av is streaming (be the central) */
#ifndef BTA_DM_AVOID_SCATTER_A2DP
#define BTA_DM_AVOID_SCATTER_A2DP TRUE
#endif
@@ -62,7 +62,7 @@ const tBTA_DM_CFG bta_dm_cfg = {
    BTA_DM_PAGE_TIMEOUT,
    /* link supervision timeout in 625uS*/
    BTA_DM_LINK_TIMEOUT,
    /* true to avoid scatternet when av is streaming (be the master) */
    /* true to avoid scatternet when av is streaming (be the central) */
    BTA_DM_AVOID_SCATTER_A2DP};

#ifndef BTA_DM_SCATTERNET
@@ -76,12 +76,12 @@ const tBTA_DM_CFG bta_dm_cfg = {
#endif

#ifndef BTA_AV_ROLE
/* By default, AV role (backward BTA_MASTER_ROLE_PREF) */
#define BTA_AV_ROLE BTA_MASTER_ROLE_PREF
/* By default, AV role (backward BTA_CENTRAL_ROLE_PREF) */
#define BTA_AV_ROLE BTA_CENTRAL_ROLE_PREF
#endif

#ifndef BTA_PANU_ROLE
/* By default, AV role (backward BTA_MASTER_ROLE_PREF) */
/* By default, AV role (backward BTA_CENTRAL_ROLE_PREF) */
#define BTA_PANU_ROLE BTA_SLAVE_ROLE_ONLY
#endif
#define BTA_DM_NUM_RM_ENTRY 6
@@ -99,7 +99,7 @@ const tBTA_DM_RM bta_dm_rm_cfg[] = {
    {BTA_ID_SYS, BTA_DM_NUM_RM_ENTRY, BTA_DM_SCATTERNET},
    {BTA_ID_PAN, BTUI_PAN_ID_NAP, BTA_ANY_ROLE},
    {BTA_ID_PAN, BTUI_PAN_ID_GN, BTA_ANY_ROLE},
    {BTA_ID_PAN, BTA_APP_ID_PAN_MULTI, BTA_MASTER_ROLE_ONLY},
    {BTA_ID_PAN, BTA_APP_ID_PAN_MULTI, BTA_CENTRAL_ROLE_ONLY},
    {BTA_ID_PAN, BTUI_PAN_ID_PANU, BTA_PANU_ROLE},
    {BTA_ID_HH, BTA_ALL_APP_ID, BTA_HH_ROLE},
    {BTA_ID_AV, BTA_ALL_APP_ID, BTA_AV_ROLE}};
+2 −2
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ typedef struct {
  alarm_t* disable_timer;
  uint32_t wbt_sdp_handle; /* WIDCOMM Extensions SDP record handle */
  uint8_t wbt_scn;         /* WIDCOMM Extensions SCN */
  uint8_t num_master_only;
  uint8_t num_central_only;
  uint8_t pm_id;
  tBTA_PM_TIMER pm_timer[BTA_DM_NUM_PM_TIMER];
  uint8_t cur_av_count;   /* current AV connecions */
@@ -342,7 +342,7 @@ typedef struct {
  uint16_t page_timeout; /* timeout for page in slots */
  uint16_t link_timeout; /* link supervision timeout in slots */
  bool avoid_scatter; /* true to avoid scatternet when av is streaming (be the
                         master) */
                         central) */

} tBTA_DM_CFG;

Loading