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

Commit 80244c1f authored by Hui Peng's avatar Hui Peng Committed by Android (Google) Code Review
Browse files

Merge "[conflict resolved] Merge "Add type validation in bta_hf_client_sdp.cc"...

Merge "[conflict resolved] Merge "Add type validation in bta_hf_client_sdp.cc" into tm-dev am: 963f729d am: 0e8867c9 am: 235d2c67" into udc-dev-plus-aosp
parents cbae24c6 9fc1578f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -259,7 +259,9 @@ bool bta_hf_client_sdp_find_attr(tBTA_HF_CLIENT_CB* client_cb) {
    /* get features */
    p_attr = get_legacy_stack_sdp_api()->record.SDP_FindAttributeInRec(
        p_rec, ATTR_ID_SUPPORTED_FEATURES);
    if (p_attr != NULL) {
    if (p_attr != NULL &&
        SDP_DISC_ATTR_TYPE(p_attr->attr_len_type) == UINT_DESC_TYPE &&
        SDP_DISC_ATTR_LEN(p_attr->attr_len_type) >= 2) {
      /* Found attribute. Get value. */
      /* There might be race condition between SDP and BRSF.  */
      /* Do not update if we already received BRSF.           */
@@ -275,7 +277,9 @@ bool bta_hf_client_sdp_find_attr(tBTA_HF_CLIENT_CB* client_cb) {
        /* get network for ability to reject calls */
        p_attr = get_legacy_stack_sdp_api()->record.SDP_FindAttributeInRec(
            p_rec, ATTR_ID_NETWORK);
        if (p_attr != NULL) {
        if (p_attr != NULL &&
            SDP_DISC_ATTR_TYPE(p_attr->attr_len_type) == UINT_DESC_TYPE &&
            SDP_DISC_ATTR_LEN(p_attr->attr_len_type) >= 2) {
          if (p_attr->attr_value.v.u16 == 0x01) {
            client_cb->peer_features |= BTA_HF_CLIENT_PEER_REJECT;
          }