Merge "AVRCP: Passthrough code cleanup"
diff --git a/bta/ag/bta_ag_cmd.cc b/bta/ag/bta_ag_cmd.cc
index 1d07de2..a9f8c1c 100644
--- a/bta/ag/bta_ag_cmd.cc
+++ b/bta/ag/bta_ag_cmd.cc
@@ -1166,19 +1166,24 @@
break;
case BTA_AG_LOCAL_EVT_BRSF:
+ {
/* store peer features */
p_scb->peer_features = (uint16_t) int_arg;
-#if (BTA_HFP_VERSION < HFP_VERSION_1_7 || BTA_HFP_HF_IND_SUPPORTED != true)
- p_scb->features &= ~BTA_AG_FEAT_HF_IND;
-#endif
+
+ tBTA_AG_FEAT features = p_scb->features;
+ if (p_scb->peer_version < HFP_VERSION_1_7)
+ {
+ features &= HFP_1_6_FEAT_MASK;
+ }
+
APPL_TRACE_DEBUG("%s BRSF HF: 0x%x, phone: 0x%x", __func__,
- p_scb->peer_features, p_scb->features);
+ p_scb->peer_features, features);
/* send BRSF, send OK */
- bta_ag_send_result(p_scb, BTA_AG_LOCAL_RES_BRSF, NULL,
- (int16_t) (p_scb->features & BTA_AG_BSRF_FEAT_SPEC));
+ bta_ag_send_result(p_scb, BTA_AG_LOCAL_RES_BRSF, NULL, (int16_t) features);
bta_ag_send_ok(p_scb);
break;
+ }
case BTA_AG_AT_NREC_EVT:
/* if feature send OK, else don't call callback, send ERROR */
diff --git a/bta/include/bta_ag_api.h b/bta/include/bta_ag_api.h
index 4754f8e..13f0554 100644
--- a/bta/include/bta_ag_api.h
+++ b/bta/include/bta_ag_api.h
@@ -49,10 +49,6 @@
#define BTA_HFP_VERSION HFP_VERSION_1_7
#endif
-#ifndef BTA_HFP_HF_IND_SUPPORTED
-#define BTA_HFP_HF_IND_SUPPORTED TRUE
-#endif
-
/* AG feature masks */
#define BTA_AG_FEAT_3WAY 0x00000001 /* Three-way calling */
#define BTA_AG_FEAT_ECNR 0x00000002 /* Echo cancellation and/or noise reduction */
@@ -64,9 +60,14 @@
#define BTA_AG_FEAT_ECC 0x00000080 /* Enhanced Call Control */
#define BTA_AG_FEAT_EXTERR 0x00000100 /* Extended error codes */
#define BTA_AG_FEAT_CODEC 0x00000200 /* Codec Negotiation */
+
+#define HFP_1_6_FEAT_MASK 0x000003FF /* Valid feature bit mask for HFP 1.6 (and below) */
+
+/* HFP 1.7+ */
#define BTA_AG_FEAT_HF_IND 0x00000400 /* HF Indicators */
#define BTA_AG_FEAT_ESCO 0x00000800 /* eSCO S4 (and T2) setting supported */
+
/* Proprietary features: using 31 ~ 16 bits */
#define BTA_AG_FEAT_BTRH 0x00010000 /* CCAP incoming call hold */
#define BTA_AG_FEAT_UNAT 0x00020000 /* Pass unknown AT commands to application */