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

Commit 850b0967 authored by shihchienc's avatar shihchienc
Browse files

[HFP1.9] Make sure LC3 is really supported in host side

Currently for local ag features, BTA_AG_FEAT_HF_IND is same as BTA_AG_FEAT_SWB.
So in current logic, when remote asks for ag supported features during
sdp, we will always indicate that swb supported in sdp response.

This patch fixed that.

Bug: 298529447
Test: atest --host net_test_btif_stack net_test_stack_btu net_test_stack_btm -c
Test: manual test and make sure host sending swb not supported when it
is not really supported.

Change-Id: I0b0fc210fcf82e89df5867642b56b020323c53e7
parent 373e5fbd
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -160,7 +160,6 @@ bool bta_ag_add_record(uint16_t service_uuid, const char* p_service_name,
  uint8_t network;
  bool result = true;
  bool codec_supported = false;
  bool swb_supported = false;
  uint8_t buf[2];

  APPL_TRACE_DEBUG("%s uuid: %x", __func__, service_uuid);
@@ -214,19 +213,16 @@ bool bta_ag_add_record(uint16_t service_uuid, const char* p_service_name,
        sdp_handle, ATTR_ID_DATA_STORES_OR_NETWORK, UINT_DESC_TYPE, 1,
        &network);

    // check property for SWB support
    if (hfp_hal_interface::get_swb_supported()) {
      features |= BTA_AG_FEAT_SWB;
    }

    if (features & BTA_AG_FEAT_CODEC) codec_supported = true;
    if (features & BTA_AG_FEAT_SWB) swb_supported = true;

    features &= BTA_AG_SDP_FEAT_SPEC;

    /* Codec bit position is different in SDP and in BRSF */
    if (codec_supported) features |= BTA_AG_FEAT_WBS_SUPPORT;
    if (swb_supported) features |= BTA_AG_FEAT_SWB_SUPPORT;
    // check property for SWB support
    if (hfp_hal_interface::get_swb_supported()) {
      features |= BTA_AG_FEAT_SWB_SUPPORT;
    }

    UINT16_TO_BE_FIELD(buf, features);
    result &= get_legacy_stack_sdp_api()->handle.SDP_AddAttribute(
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@
#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 BTA_AG_FEAT_SWB 0x00000400    /* Super Wide Band */
#define BTA_AG_FEAT_SWB 0x00001000    /* Super Wide Band */

/* AG SDP feature masks */
#define BTA_AG_FEAT_WBS_SUPPORT 0x0020 /* Supports WBS */