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

Commit 397eabe6 authored by Antoine SOULIER's avatar Antoine SOULIER
Browse files

[avrcp] Fix version of controller

The AVRCP controller version should be set to 1.4 when
absolute volume is supported. Android Car target reads
this attributes and match the version. Leads to unexpected
behaviour of disabling absolute volume control.

Bug: 258826589
Tag: #feature
Test: On device
Change-Id: Id54106d90027d81c19c131d1013920a0b8a74e4e
parent 49dfb247
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -981,10 +981,14 @@ static BT_HDR* avrc_pass_msg(tAVRC_MSG_PASS* p_msg) {
 *
 *****************************************************************************/
uint16_t AVRC_GetControlProfileVersion() {
  char volume_disabled[PROPERTY_VALUE_MAX] = {0};
  osi_property_get("persist.bluetooth.disableabsvol", volume_disabled, "false");

  uint16_t profile_version = AVRC_REV_1_3;
  char avrcp_version[PROPERTY_VALUE_MAX] = {0};
  osi_property_get(AVRC_CONTROL_VERSION_PROPERTY, avrcp_version,
                   AVRC_1_3_STRING);
                   strncmp(volume_disabled, "true", 4) == 0 ? AVRC_1_3_STRING
                                                            : AVRC_1_4_STRING);

  if (!strncmp(AVRC_1_6_STRING, avrcp_version, sizeof(AVRC_1_6_STRING))) {
    profile_version = AVRC_REV_1_6;