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

Commit 68d78a3e authored by Andre Eisenbach's avatar Andre Eisenbach Committed by Myles Watson
Browse files

Mask out HFP 1.7 feature bits if peer version is <1.7

Bug: 32378402
Merged-In: I568e8c4c584d56d744cf7a30273feac1d8d4c4df
Change-Id: Iac8684bdfd02b18cce260bedefb829e8f7285361
(cherry picked from commit 1ad2678e2ff5fa3dbfae9dc76ab646db10794e4e)
(cherry picked from commit 571f23ca31cdbc87cae8c078b5885246dd779498)
parent bbfe14e0
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -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 */
+5 −4
Original line number Diff line number Diff line
@@ -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 */