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

Commit 021a9cb4 authored by Tsuyoshi Kamata's avatar Tsuyoshi Kamata Committed by Andre Eisenbach
Browse files

AVRC: Configure absolute volume to false if remove device not supprot it

Some AVRCP(ver>1.4) devices don't support absolute volume, when connected
to such device, volume control doesn't work properly on phone.

This patch fix the problem as bellow:
 - check category of remote device
     when add absolute volume feature flag.
 - remove absolute volume feature flag
     if remote device responses REJECT or NOT_IMPLEMENT.

Bug: 33441894
Change-Id: Icfd6f61699490efd937fa6d2383f333eb0f0144a
parent 8829f2f1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1632,11 +1632,12 @@ tBTA_AV_FEAT bta_av_check_peer_features(uint16_t service_uuid) {
        peer_features |= (BTA_AV_FEAT_VENDOR | BTA_AV_FEAT_METADATA);

      if (peer_rc_version >= AVRC_REV_1_4) {
        peer_features |= (BTA_AV_FEAT_ADV_CTRL);
        /* get supported categories */
        p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SUPPORTED_FEATURES);
        if (p_attr != NULL) {
          categories = p_attr->attr_value.v.u16;
          if (categories & AVRC_SUPF_CT_CAT2)
            peer_features |= (BTA_AV_FEAT_ADV_CTRL);
          if (categories & AVRC_SUPF_CT_BROWSE)
            peer_features |= (BTA_AV_FEAT_BROWSE);
        }
+9 −0
Original line number Diff line number Diff line
@@ -2747,6 +2747,15 @@ static void handle_rc_metamsg_rsp(tBTA_AV_META_MSG* pmeta_msg,
          __func__, pmeta_msg->code, pmeta_msg->label);
      return;
    }

    if (AVRC_PDU_REGISTER_NOTIFICATION == avrc_response.rsp.pdu &&
        AVRC_EVT_VOLUME_CHANGE == avrc_response.reg_notif.event_id &&
        (AVRC_RSP_REJ == pmeta_msg->code || AVRC_RSP_NOT_IMPL == pmeta_msg->code)) {
      BTIF_TRACE_DEBUG("%s remove AbsoluteVolume feature flag.", __func__);
      p_dev->rc_features &= ~BTA_AV_FEAT_ADV_CTRL;
      handle_rc_features(p_dev);
      return;
    }
  } else {
    BTIF_TRACE_DEBUG(
        "%s: Received vendor dependent in adv ctrl rsp. code: %d len: %d. Not "