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

Commit 9321662b authored by Chris Manton's avatar Chris Manton
Browse files

stack::sdp [3/12] record.SDP_FindProfileVersionInRec

Bug: 339311914
Test: m .
Flag: EXEMPT, Logging Change

Change-Id: I428867ed53c119c07705bf393e2dd377b321b678
parent 1b4c9972
Loading
Loading
Loading
Loading
+25 −10
Original line number Diff line number Diff line
@@ -1776,8 +1776,11 @@ static void bta_av_store_peer_rc_version() {
    if ((get_legacy_stack_sdp_api()->record.SDP_FindAttributeInRec(
            p_rec, ATTR_ID_BT_PROFILE_DESC_LIST)) != NULL) {
      /* get profile version (if failure, version parameter is not updated) */
      get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
          p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version);
      if (!get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
              p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version)) {
        log::warn("Unable to find AVRC profile version in record peer:{}",
                  p_rec->remote_bd_addr);
      }
    }
    if (peer_rc_version != 0)
      DEVICE_IOT_CONFIG_ADDR_SET_HEX_IF_GREATER(
@@ -1791,8 +1794,11 @@ static void bta_av_store_peer_rc_version() {
    if ((get_legacy_stack_sdp_api()->record.SDP_FindAttributeInRec(
            p_rec, ATTR_ID_BT_PROFILE_DESC_LIST)) != NULL) {
      /* get profile version (if failure, version parameter is not updated) */
      get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
          p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version);
      if (!get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
              p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version)) {
        log::warn("Unable to find SDP profile version in record peer:{}",
                  p_rec->remote_bd_addr);
      }
    }
    if (peer_rc_version != 0)
      DEVICE_IOT_CONFIG_ADDR_SET_HEX_IF_GREATER(
@@ -1845,8 +1851,11 @@ tBTA_AV_FEAT bta_av_check_peer_features(uint16_t service_uuid) {
    if ((get_legacy_stack_sdp_api()->record.SDP_FindAttributeInRec(
            p_rec, ATTR_ID_BT_PROFILE_DESC_LIST)) != NULL) {
      /* get profile version (if failure, version parameter is not updated) */
      get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
          p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version);
      if (!get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
              p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version)) {
        log::warn("Unable to find AVRC profile version in record peer:{}",
                  p_rec->remote_bd_addr);
      }
      log::verbose("peer_rc_version 0x{:x}", peer_rc_version);

      if (peer_rc_version >= AVRC_REV_1_3)
@@ -2128,8 +2137,11 @@ void bta_av_rc_disc_done_all(tBTA_AV_DATA* /* p_data */) {
            p_rec, ATTR_ID_BT_PROFILE_DESC_LIST) != NULL) {
      /* get profile version (if failure, version parameter is not updated) */
      uint16_t peer_rc_version = 0xFFFF;  // Don't change the AVRCP version
      get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
          p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version);
      if (!get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
              p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version)) {
        log::warn("Unable to find SDP in record peer:{}",
                  p_rec->remote_bd_addr);
      }
      if (peer_rc_version <= AVRC_REV_1_3) {
        log::verbose("Using AVRCP 1.3 Capabilities with remote device");
        p_bta_av_cfg = &bta_av_cfg_compatibility;
@@ -2320,8 +2332,11 @@ void bta_av_rc_disc_done(tBTA_AV_DATA* p_data) {
            p_rec, ATTR_ID_BT_PROFILE_DESC_LIST) != NULL) {
      /* get profile version (if failure, version parameter is not updated) */
      uint16_t peer_rc_version = 0xFFFF;  // Don't change the AVRCP version
      get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
          p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version);
      if (!get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
              p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version)) {
        log::warn("Unable to find AVRCP version peer:{}",
                  p_rec->remote_bd_addr);
      }
      if (peer_rc_version <= AVRC_REV_1_3) {
        log::verbose("Using AVRCP 1.3 Capabilities with remote device");
        p_bta_av_cfg = &bta_av_cfg_compatibility;
+5 −2
Original line number Diff line number Diff line
@@ -355,8 +355,11 @@ static void bta_dm_store_audio_profiles_version() {

    uint16_t profile_version = 0;
    /* get profile version (if failure, version parameter is not updated) */
    get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
        sdp_rec, audio_profile.btprofile_uuid, &profile_version);
    if (!get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
            sdp_rec, audio_profile.btprofile_uuid, &profile_version)) {
      log::warn("Unable to find SDP profile version in record peer:{}",
                sdp_rec->remote_bd_addr);
    }
    if (profile_version != 0) {
      if (btif_config_set_bin(sdp_rec->remote_bd_addr.ToString().c_str(),
                              audio_profile.profile_key,
+5 −2
Original line number Diff line number Diff line
@@ -574,8 +574,11 @@ static void bta_dm_store_audio_profiles_version() {

    uint16_t profile_version = 0;
    /* get profile version (if failure, version parameter is not updated) */
    get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
        sdp_rec, audio_profile.btprofile_uuid, &profile_version);
    if (!get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
            sdp_rec, audio_profile.btprofile_uuid, &profile_version)) {
      log::warn("Unable to find SDP profile version in record peer:{}",
                sdp_rec->remote_bd_addr);
    }
    if (profile_version != 0) {
      if (btif_config_set_bin(sdp_rec->remote_bd_addr.ToString().c_str(),
                              audio_profile.profile_key,
+5 −2
Original line number Diff line number Diff line
@@ -261,8 +261,11 @@ bool bta_hf_client_sdp_find_attr(tBTA_HF_CLIENT_CB* client_cb) {
    }

    /* get profile version (if failure, version parameter is not updated) */
    get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
        p_rec, UUID_SERVCLASS_HF_HANDSFREE, &client_cb->peer_version);
    if (!get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
            p_rec, UUID_SERVCLASS_HF_HANDSFREE, &client_cb->peer_version)) {
      log::warn("Uable to find HFP profile version in SDP record peer:{}",
                p_rec->remote_bd_addr);
    }

    /* get features */
    p_attr = get_legacy_stack_sdp_api()->record.SDP_FindAttributeInRec(
+4 −2
Original line number Diff line number Diff line
@@ -599,8 +599,10 @@ static void bta_sdp_search_cback(const RawAddress& /* bd_addr */,
        if (p_rec != NULL) {
          uint16_t peer_pce_version = 0;

          get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
              p_rec, UUID_SERVCLASS_PHONE_ACCESS, &peer_pce_version);
          if (!get_legacy_stack_sdp_api()->record.SDP_FindProfileVersionInRec(
                  p_rec, UUID_SERVCLASS_PHONE_ACCESS, &peer_pce_version)) {
            log::warn("Unable to find PBAP profile version in SDP record");
          }
          if (peer_pce_version != 0) {
            btif_storage_set_pce_profile_version(p_rec->remote_bd_addr,
                                                 peer_pce_version);