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

Commit c9c2839f authored by Hansong Zhang's avatar Hansong Zhang
Browse files

BTA_AV_FEAT_CENTRAL is never used.

Features can be traced down to BTA_AvEnable().

BTA_AV_FEAT_CENTRAL is never set.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I9bbdcc69d12019d2b7dc9f60b780878b2912b4d8
parent 87468350
Loading
Loading
Loading
Loading
+3 −15
Original line number Diff line number Diff line
@@ -780,9 +780,6 @@ 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_CENTRAL) {
    BTM_default_block_role_switch();
  }
  /* store peer addr other parameters */
  bta_av_save_addr(p_scb, p_data->api_open.bd_addr);
  p_scb->use_rc = p_data->api_open.use_rc;
@@ -1867,10 +1864,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_CENTRAL) == 0 ||
      bta_av_cb.audio_open_cnt == 1) {
  BTM_unblock_role_switch_for(p_scb->PeerAddress());
  }

  if (p_scb->co_started) {
    if (p_scb->offload_started) {
@@ -2382,10 +2376,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_CENTRAL) == 0 ||
      bta_av_cb.audio_open_cnt == 1) {
  BTM_unblock_role_switch_for(p_scb->PeerAddress());
  }
  if (bta_av_cb.audio_open_cnt <= 1) {
    BTM_default_unblock_role_switch();
  }
@@ -2493,10 +2484,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_CENTRAL) == 0 ||
      bta_av_cb.audio_open_cnt == 1) {
  BTM_unblock_role_switch_for(p_scb->PeerAddress());
  }

  /* in case that we received suspend_ind, we may need to call co_stop here */
  if (p_scb->co_started) {
+1 −5
Original line number Diff line number Diff line
@@ -1010,11 +1010,7 @@ bool bta_av_link_role_ok(tBTA_AV_SCB* p_scb, uint8_t bits) {
        __func__, p_scb->PeerAddress().ToString().c_str(), p_scb->hndl, role,
        bta_av_cb.conn_audio, bits, bta_av_cb.features);
    if (HCI_ROLE_CENTRAL != role &&
        (A2DP_BitsSet(bta_av_cb.conn_audio) > bits ||
         (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());

        (A2DP_BitsSet(bta_av_cb.conn_audio) > bits)) {
      tBTM_STATUS status = BTM_SwitchRoleToCentral(p_scb->PeerAddress());
      if (status != BTM_CMD_STARTED) {
        /* can not switch role on SCB - start the timer on SCB */
+0 −1
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@ typedef uint8_t tBTA_AV_STATUS;
#define BTA_AV_FEAT_MULTI_AV \
  0x0080                          /* use multi-av, if controller supports it */
#define BTA_AV_FEAT_BROWSE 0x0010 /* use browsing channel */
#define BTA_AV_FEAT_CENTRAL 0x0100 /* stream only as central role */
#define BTA_AV_FEAT_ADV_CTRL \
  0x0200 /* remote control Advanced Control command/response */
#define BTA_AV_FEAT_DELAY_RPT 0x0400 /* allow delay reporting */