diff options
author | Andre Eisenbach <eisenbach@google.com> | 2016-11-04 17:43:17 -0700 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2016-11-07 16:33:42 -0800 |
commit | b90b669eb40316f13df9f080add09c29139f4d3a (patch) | |
tree | 594d030129029fc3fd87516db013f642c119c7c1 | |
parent | 699c01a12eec65e768fc6d41f4913ad6f1529b34 (diff) | |
download | bt-nougat-mr1-cts-release.tar.gz |
Mask out HFP 1.7 feature bits if peer version is <1.7android-cts_7.1_r1android-cts-7.1_r9android-cts-7.1_r8android-cts-7.1_r7android-cts-7.1_r6android-cts-7.1_r5android-cts-7.1_r4android-cts-7.1_r3android-cts-7.1_r29android-cts-7.1_r28android-cts-7.1_r27android-cts-7.1_r26android-cts-7.1_r25android-cts-7.1_r24android-cts-7.1_r23android-cts-7.1_r22android-cts-7.1_r21android-cts-7.1_r20android-cts-7.1_r2android-cts-7.1_r19android-cts-7.1_r18android-cts-7.1_r17android-cts-7.1_r16android-cts-7.1_r15android-cts-7.1_r14android-cts-7.1_r13android-cts-7.1_r12android-cts-7.1_r11android-cts-7.1_r10android-cts-7.1_r1android-7.1.1_r9android-7.1.1_r8android-7.1.1_r7android-7.1.1_r6android-7.1.1_r4android-7.1.1_r3android-7.1.1_r28android-7.1.1_r23android-7.1.1_r22android-7.1.1_r17android-7.1.1_r13nougat-mr1.2-releasenougat-mr1-releasenougat-mr1-cts-release
Bug: 32378402
Merged-In: I568e8c4c584d56d744cf7a30273feac1d8d4c4df
Change-Id: Iac8684bdfd02b18cce260bedefb829e8f7285361
(cherry picked from commit 1ad2678e2ff5fa3dbfae9dc76ab646db10794e4e)
(cherry picked from commit 571f23ca31cdbc87cae8c078b5885246dd779498)
(cherry picked from commit ebba3ef2ea5061a48aa0de49ebfdb98df64d803f)
-rw-r--r-- | bta/ag/bta_ag_cmd.c | 17 | ||||
-rw-r--r-- | bta/include/bta_ag_api.h | 9 |
2 files changed, 16 insertions, 10 deletions
diff --git a/bta/ag/bta_ag_cmd.c b/bta/ag/bta_ag_cmd.c index 110b53151..973e26e93 100644 --- a/bta/ag/bta_ag_cmd.c +++ b/bta/ag/bta_ag_cmd.c @@ -1346,19 +1346,24 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type, break; case BTA_AG_HF_CMD_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_RES_BRSF, NULL, - (INT16) (p_scb->features & BTA_AG_BSRF_FEAT_SPEC)); + bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL, (int16_t) features); bta_ag_send_ok(p_scb); break; + } case BTA_AG_HF_CMD_NREC: /* 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 fa76a5776..e281fb101 100644 --- a/bta/include/bta_ag_api.h +++ b/bta/include/bta_ag_api.h @@ -45,10 +45,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 */ @@ -60,9 +56,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 */ |