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

Commit 93c02787 authored by Joseph Pirozzo's avatar Joseph Pirozzo
Browse files

Remove BTA_AV_SINK_INCLUDE

Remove the need to define BTA_AV_SINK_INCLUDE in addition to enabling
the profile_supported_a2dp_sink.  The code is already dependent on the
existance of sdp_a2dp_snk_handle, and the initialization of the
UUID_SERVCLASS_AUDIO_SINK which is only performed on devices including
A2DP Sink support.

Bug: 153203307
Test: atest BluetoothInstrumentationTests
Tag: #refactor
Change-Id: Ib259fd0b69d853ef21cb1852cd54237602a01f61
parent c0a80833
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -1908,7 +1908,6 @@ void bta_av_rc_disc_done(UNUSED_ATTR tBTA_AV_DATA* p_data) {
  }

  APPL_TRACE_DEBUG("%s: rc_handle %d", __func__, rc_handle);
#if (BTA_AV_SINK_INCLUDED == TRUE)
  if (p_cb->sdp_a2dp_snk_handle) {
    /* This is Sink + CT + TG(Abs Vol) */
    peer_features =
@@ -1924,9 +1923,7 @@ void bta_av_rc_disc_done(UNUSED_ATTR tBTA_AV_DATA* p_data) {

    APPL_TRACE_DEBUG("%s: populating rem ctrl target bip psm 0x%x", __func__,
                     cover_art_psm);
  } else
#endif
      if (p_cb->sdp_a2dp_handle) {
  } else if (p_cb->sdp_a2dp_handle) {
    /* check peer version and whether support CT and TG role */
    peer_features =
        bta_av_check_peer_features(UUID_SERVCLASS_AV_REMOTE_CONTROL);
@@ -2292,13 +2289,11 @@ void bta_av_dereg_comp(tBTA_AV_DATA* p_data) {
        bta_sys_remove_uuid(UUID_SERVCLASS_AUDIO_SOURCE);
      }

#if (BTA_AV_SINK_INCLUDED == TRUE)
      if (p_cb->sdp_a2dp_snk_handle) {
        bta_av_del_sdp_rec(&p_cb->sdp_a2dp_snk_handle);
        p_cb->sdp_a2dp_snk_handle = 0;
        bta_sys_remove_uuid(UUID_SERVCLASS_AUDIO_SINK);
      }
#endif
    }

    bta_av_free_scb(p_scb);
+0 −4
Original line number Diff line number Diff line
@@ -137,12 +137,10 @@ static void bta_av_api_enable(tBTA_AV_DATA* p_data) {
      SDP_DeleteRecord(bta_av_cb.sdp_a2dp_handle);
      bta_sys_remove_uuid(UUID_SERVCLASS_AUDIO_SOURCE);
    }
#if (BTA_AV_SINK_INCLUDED == TRUE)
    if (bta_av_cb.sdp_a2dp_snk_handle) {
      SDP_DeleteRecord(bta_av_cb.sdp_a2dp_snk_handle);
      bta_sys_remove_uuid(UUID_SERVCLASS_AUDIO_SINK);
    }
#endif
    // deregister from AVDT
    bta_ar_dereg_avdt();

@@ -599,12 +597,10 @@ static void bta_av_api_register(tBTA_AV_DATA* p_data) {
                       A2DP_SUPF_PLAYER, bta_av_cb.sdp_a2dp_handle);
        bta_sys_add_uuid(UUID_SERVCLASS_AUDIO_SOURCE);
      } else if (profile_initialized == UUID_SERVCLASS_AUDIO_SINK) {
#if (BTA_AV_SINK_INCLUDED == TRUE)
        bta_av_cb.sdp_a2dp_snk_handle = SDP_CreateRecord();
        A2DP_AddRecord(UUID_SERVCLASS_AUDIO_SINK, p_service_name, NULL,
                       A2DP_SUPF_PLAYER, bta_av_cb.sdp_a2dp_snk_handle);
        bta_sys_add_uuid(UUID_SERVCLASS_AUDIO_SINK);
#endif
      }
      /* start listening when A2DP is registered */
      if (bta_av_cb.features & BTA_AV_FEAT_RCTG)