OSDN Git Service

Disable SCMST feature for A2DP Sink
authorAnubhav Gupta <anubhavg@codeaurora.org>
Thu, 19 Jun 2014 11:20:11 +0000 (16:50 +0530)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 5 Jun 2015 00:37:16 +0000 (00:37 +0000)
Do not send SCMST enabled in GetCapabilities
for A2dp sink role.

Change-Id: I2bff7e04d852c6d3c8c1b7e1c41ae50ef3ff0543

btif/co/bta_av_co.c

index 1460fca..e410f14 100644 (file)
@@ -281,6 +281,16 @@ BOOLEAN bta_av_co_audio_init(UINT8 *p_codec_type, UINT8 *p_codec_info, UINT8 *p_
 
     APPL_TRACE_DEBUG("bta_av_co_audio_init: %d", index);
 
+    /* By default - no content protection info */
+    *p_num_protect = 0;
+    *p_protect_info = 0;
+
+    /* reset remote preference through setconfig */
+    bta_av_co_cb.codec_cfg_setconfig.id = BTIF_AV_CODEC_NONE;
+
+    switch (index)
+    {
+    case BTIF_SV_AV_AA_SBC_INDEX:
 #if defined(BTA_AV_CO_CP_SCMS_T) && (BTA_AV_CO_CP_SCMS_T == TRUE)
     {
         UINT8 *p = p_protect_info;
@@ -291,18 +301,7 @@ BOOLEAN bta_av_co_audio_init(UINT8 *p_codec_type, UINT8 *p_codec_info, UINT8 *p_
         UINT16_TO_STREAM(p, BTA_AV_CP_SCMS_T_ID);
 
     }
-#else
-    /* By default - no content protection info */
-    *p_num_protect = 0;
-    *p_protect_info = 0;
 #endif
-
-    /* reset remote preference through setconfig */
-    bta_av_co_cb.codec_cfg_setconfig.id = BTIF_AV_CODEC_NONE;
-
-    switch (index)
-    {
-    case BTIF_SV_AV_AA_SBC_INDEX:
         /* Set up for SBC codec  for SRC*/
         *p_codec_type = BTA_AV_CODEC_SBC;
 
@@ -552,19 +551,8 @@ UINT8 bta_av_audio_sink_getconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
                 *p_num_protect = 0;
 
 #if defined(BTA_AV_CO_CP_SCMS_T) && (BTA_AV_CO_CP_SCMS_T == TRUE)
-                /* Check if this sink supports SCMS */
-                if (bta_av_co_audio_sink_has_scmst(p_sink))
-                {
-                    p_peer->cp_active = TRUE;
-                    bta_av_co_cb.cp.active = TRUE;
-                    *p_num_protect = BTA_AV_CP_INFO_LEN;
-                    memcpy(p_protect_info, bta_av_co_cp_scmst, BTA_AV_CP_INFO_LEN);
-                }
-                else
-                {
                     p_peer->cp_active = FALSE;
                     bta_av_co_cb.cp.active = FALSE;
-                }
 #endif
 
                     *p_sep_info_idx = p_src->sep_info_idx;