system/bt
Revision | ae0148c1f94858856e557293785993dc3ea4a285 (tree) |
---|---|
Zeit | 2017-04-20 09:01:23 |
Autor | Tsuyoshi Kamata <tsuyoshi.x.kamata@sony...> |
Commiter | Pavlin Radoslavov |
AVRC: Configure absolute volume to false if remove device not support 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:
Bug: 33441894
Test: manual
Change-Id: Icfd6f61699490efd937fa6d2383f333eb0f0144a
(cherry picked from commit a4fcd238aedee87384fa164e9465302aa4b69035)
@@ -1632,11 +1632,12 @@ tBTA_AV_FEAT bta_av_check_peer_features(uint16_t service_uuid) { | ||
1632 | 1632 | peer_features |= (BTA_AV_FEAT_VENDOR | BTA_AV_FEAT_METADATA); |
1633 | 1633 | |
1634 | 1634 | if (peer_rc_version >= AVRC_REV_1_4) { |
1635 | - peer_features |= (BTA_AV_FEAT_ADV_CTRL); | |
1636 | 1635 | /* get supported categories */ |
1637 | 1636 | p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SUPPORTED_FEATURES); |
1638 | 1637 | if (p_attr != NULL) { |
1639 | 1638 | categories = p_attr->attr_value.v.u16; |
1639 | + if (categories & AVRC_SUPF_CT_CAT2) | |
1640 | + peer_features |= (BTA_AV_FEAT_ADV_CTRL); | |
1640 | 1641 | if (categories & AVRC_SUPF_CT_BROWSE) |
1641 | 1642 | peer_features |= (BTA_AV_FEAT_BROWSE); |
1642 | 1643 | } |
@@ -2747,6 +2747,16 @@ static void handle_rc_metamsg_rsp(tBTA_AV_META_MSG* pmeta_msg, | ||
2747 | 2747 | __func__, pmeta_msg->code, pmeta_msg->label); |
2748 | 2748 | return; |
2749 | 2749 | } |
2750 | + | |
2751 | + if (AVRC_PDU_REGISTER_NOTIFICATION == avrc_response.rsp.pdu && | |
2752 | + AVRC_EVT_VOLUME_CHANGE == avrc_response.reg_notif.event_id && | |
2753 | + (AVRC_RSP_REJ == pmeta_msg->code || | |
2754 | + AVRC_RSP_NOT_IMPL == pmeta_msg->code)) { | |
2755 | + BTIF_TRACE_DEBUG("%s remove AbsoluteVolume feature flag.", __func__); | |
2756 | + p_dev->rc_features &= ~BTA_AV_FEAT_ADV_CTRL; | |
2757 | + handle_rc_features(p_dev); | |
2758 | + return; | |
2759 | + } | |
2750 | 2760 | } else { |
2751 | 2761 | BTIF_TRACE_DEBUG( |
2752 | 2762 | "%s: Received vendor dependent in adv ctrl rsp. code: %d len: %d. Not " |