From 0ae5bb34fd1a17d63eb78bbabd1f27f4aa13fdc0 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 24 Sep 2020 13:12:22 -0700 Subject: [PATCH] AVRC uses the same mtu Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: I365e3ab3a2f7ee223e9242c2643ce51235a02d6b --- bta/av/bta_av_cfg.cc | 3 --- bta/av/bta_av_main.cc | 4 ++-- bta/include/bta_av_api.h | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bta/av/bta_av_cfg.cc b/bta/av/bta_av_cfg.cc index 3052d0038..b1fabeb79 100644 --- a/bta/av/bta_av_cfg.cc +++ b/bta/av/bta_av_cfg.cc @@ -132,7 +132,6 @@ const uint8_t bta_av_meta_caps_evt_ids_avrcp13[] = { /* This configuration to be used when we are Src + TG + CT( only for abs vol) */ const tBTA_AV_CFG bta_av_cfg = { BTA_AV_RC_COMP_ID, /* AVRCP Company ID */ - 512, /* AVRCP MTU at L2CAP for control channel */ BTA_AV_MAX_RC_BR_MTU, /* AVRCP MTU at L2CAP for browsing channel */ BTA_AV_RC_SUPF_CT, /* AVRCP controller categories */ BTA_AV_RC_SUPF_TG, /* AVRCP target categories */ @@ -158,7 +157,6 @@ const tBTA_AV_CFG bta_av_cfg = { */ const tBTA_AV_CFG bta_avk_cfg = { AVRC_CO_METADATA, /* AVRCP Company ID */ - 512, /* AVRCP MTU at L2CAP for control channel */ BTA_AV_MAX_RC_BR_MTU, /* AVRCP MTU at L2CAP for browsing channel */ BTA_AVK_RC_SUPF_CT, /* AVRCP controller categories */ BTA_AVK_RC_SUPF_TG, /* AVRCP target categories */ @@ -182,7 +180,6 @@ const tBTA_AV_CFG bta_avk_cfg = { /* This configuration to be used when we are using AVRCP1.3 */ const tBTA_AV_CFG bta_av_cfg_compatibility = { BTA_AV_RC_COMP_ID, /* AVRCP Company ID */ - 512, /* AVRCP MTU at L2CAP for control channel */ BTA_AV_MAX_RC_BR_MTU, /* AVRCP MTU at L2CAP for browsing channel */ BTA_AV_RC_SUPF_CT, /* AVRCP controller categories */ AVRC_SUPF_TG_CAT1, /* Only support CAT1 for AVRCP1.3 */ diff --git a/bta/av/bta_av_main.cc b/bta/av/bta_av_main.cc index 87f1587e9..bfdfc89ab 100644 --- a/bta/av/bta_av_main.cc +++ b/bta/av/bta_av_main.cc @@ -472,7 +472,7 @@ static void bta_av_api_register(tBTA_AV_DATA* p_data) { if (bta_av_cb.features & (BTA_AV_FEAT_RCTG)) { /* register with no authorization; let AVDTP use authorization instead */ - bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu); + bta_ar_reg_avct(kAvrcMtu, p_bta_av_cfg->avrc_br_mtu); /* For the Audio Sink role we support additional TG to support * absolute volume. @@ -619,7 +619,7 @@ static void bta_av_api_register(tBTA_AV_DATA* p_data) { if (bta_av_cb.features & (BTA_AV_FEAT_RCCT)) { /* if TG is not supported, we need to register to AVCT now */ if ((bta_av_cb.features & (BTA_AV_FEAT_RCTG)) == 0) { - bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu); + bta_ar_reg_avct(kAvrcMtu, p_bta_av_cfg->avrc_br_mtu); bta_av_rc_create(&bta_av_cb, AVCT_ACP, 0, BTA_AV_NUM_LINKS + 1); } /* create an SDP record as AVRC CT. We create 1.3 for SOURCE diff --git a/bta/include/bta_av_api.h b/bta/include/bta_av_api.h index 8b77d384c..1d3094662 100644 --- a/bta/include/bta_av_api.h +++ b/bta/include/bta_av_api.h @@ -373,10 +373,11 @@ struct tBTA_AV_SCB; union tBTA_AV_DATA; typedef void (*tBTA_AV_ACT)(tBTA_AV_SCB* p_cb, tBTA_AV_DATA* p_data); +constexpr uint16_t kAvrcMtu = 512; /* AVRCP MTU at L2CAP for control channel */ + /* AV configuration structure */ typedef struct { uint32_t company_id; /* AVRCP Company ID */ - uint16_t avrc_mtu; /* AVRCP MTU at L2CAP for control channel */ uint16_t avrc_br_mtu; /* AVRCP MTU at L2CAP for browsing channel */ uint16_t avrc_ct_cat; /* AVRCP controller categories */ uint16_t avrc_tg_cat; /* AVRCP target categories */ -- 2.11.0