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

Commit 8c35bfe6 authored by Ajay Panicker's avatar Ajay Panicker Committed by Myles Watson
Browse files

Change our AVRCP capabilities if the remote device only supports 1.3

This prevents issues with devices that only support 1.3 but can not
handle forward compatability like some Alpine Carkits.

Bug: 37943083
Test: Connect to Alpine carkit that only supports 1.3 and see new features
      are used.

Change-Id: I6d041590dc51d7e8711b17fb1cb9c880b640052a
(cherry picked from commit 6afd046f)
parent 8a2dd3c7
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -1781,6 +1781,23 @@ void bta_av_rc_disc_done(UNUSED_ATTR tBTA_AV_DATA* p_data) {
      peer_features |=
          bta_av_check_peer_features(UUID_SERVCLASS_AV_REM_CTRL_TARGET);
    }

    /* Change our features if the remote AVRCP version is 1.3 or less */
    tSDP_DISC_REC* p_rec = nullptr;
    p_rec = SDP_FindServiceInDb(p_cb->p_disc_db,
                                UUID_SERVCLASS_AV_REMOTE_CONTROL, p_rec);
    if (p_rec != NULL &&
        SDP_FindAttributeInRec(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
      SDP_FindProfileVersionInRec(p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL,
                                  &peer_rc_version);
      if (peer_rc_version <= AVRC_REV_1_3) {
        APPL_TRACE_DEBUG("%s Using AVRCP 1.3 Capabilities with remote device",
                         __func__);
        p_bta_av_cfg = (tBTA_AV_CFG*)&bta_av_cfg_compatibility;
      }
    }
  }

  p_cb->disc = 0;