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

Commit 051f077a authored by Henri Chataing's avatar Henri Chataing
Browse files

a2dp: Remove checks for disabled Content Protection

Support for content protection in AVDTP/A2DP is disabled
by default as BTA_AV_CO_CP_SCMS_T is always false.

This change removes all checks for the variable BTA_AV_CO_CP_SCMS_T.

Bug: 305283170
Test: m com.android.btservices
Change-Id: Ib0901ed513003c40985139464a2d1050db5f650b
parent da3e225a
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -705,11 +705,7 @@ class BtaAvCo {
const uint8_t bta_av_co_cp_scmst[AVDT_CP_INFO_LEN] = {0x02, 0x02, 0x00};

// Control block instance
#if (BTA_AV_CO_CP_SCMS_T == TRUE)
static const bool kContentProtectEnabled = true;
#else
static const bool kContentProtectEnabled = false;
#endif
static BtaAvCo bta_av_co_cb(kContentProtectEnabled);

void BtaAvCoPeer::Init(
+0 −5
Original line number Diff line number Diff line
@@ -85,11 +85,6 @@
#define BTA_AV_RET_TOUT 15
#endif

/* TRUE to use SCMS-T content protection */
#ifndef BTA_AV_CO_CP_SCMS_T
#define BTA_AV_CO_CP_SCMS_T FALSE
#endif

#ifndef BTA_DM_SDP_DB_SIZE
#define BTA_DM_SDP_DB_SIZE 20000
#endif
+0 −8
Original line number Diff line number Diff line
@@ -732,14 +732,6 @@ bool A2DP_InitCodecConfigAac(AvdtpSepConfig* p_cfg) {
    return false;
  }

#if (BTA_AV_CO_CP_SCMS_T == TRUE)
  /* Content protection info - support SCMS-T */
  uint8_t* p = p_cfg->protect_info;
  *p++ = AVDT_CP_LOSC;
  UINT16_TO_STREAM(p, AVDT_CP_SCMS_T_ID);
  p_cfg->num_protect = 1;
#endif

  return true;
}

+1 −8
Original line number Diff line number Diff line
@@ -39,11 +39,7 @@
#define A2DP_AAC_ENCODER_INTERVAL_MS 20

// offset
#if (BTA_AV_CO_CP_SCMS_T == TRUE)
#define A2DP_AAC_OFFSET (AVDT_MEDIA_OFFSET + 1)
#else
#define A2DP_AAC_OFFSET AVDT_MEDIA_OFFSET
#endif

typedef struct {
  uint32_t sample_rate;
@@ -135,10 +131,7 @@ void a2dp_aac_encoder_init(const tA2DP_ENCODER_INIT_PEER_PARAMS* p_peer_params,
  a2dp_aac_encoder_cb.peer_params = *p_peer_params;
  a2dp_aac_encoder_cb.timestamp = 0;

  a2dp_aac_encoder_cb.use_SCMS_T = false;  // TODO: should be a parameter
#if (BTA_AV_CO_CP_SCMS_T == TRUE)
  a2dp_aac_encoder_cb.use_SCMS_T = true;
#endif
  a2dp_aac_encoder_cb.use_SCMS_T = false;

  // NOTE: Ignore the restart_input / restart_output flags - this initization
  // happens when the audio session is (re)started.
+0 −8
Original line number Diff line number Diff line
@@ -825,14 +825,6 @@ bool A2DP_InitCodecConfigSbc(AvdtpSepConfig* p_cfg) {
    return false;
  }

#if (BTA_AV_CO_CP_SCMS_T == TRUE)
  /* Content protection info - support SCMS-T */
  uint8_t* p = p_cfg->protect_info;
  *p++ = AVDT_CP_LOSC;
  UINT16_TO_STREAM(p, AVDT_CP_SCMS_T_ID);
  p_cfg->num_protect = 1;
#endif

  return true;
}

Loading