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
Merged-In: I6d041590dc51d7e8711b17fb1cb9c880b640052a
(cherry picked from commit f9f1c8b449efb9cb7894a64fe2977f875679ba52)
(cherry picked from commit d0c2ec1679f4bb90ee8c51f7093abf0eaef9df33)
diff --git a/bta/av/bta_av_act.cc b/bta/av/bta_av_act.cc
index 1e27c25..67a8299 100644
--- a/bta/av/bta_av_act.cc
+++ b/bta/av/bta_av_act.cc
@@ -1788,6 +1788,23 @@
       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;