avrcp: Fix always requesting player settings for category 1
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 27 May 2020 22:39:56 +0000 (15:39 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:49 +0000 (14:30 +0530)
Player Application settings is not mandatory for category 1 so instead
of always listing the settings the code now checks if
AVRCP_FEATURE_PLAYER_SETTINGS is enabled.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/audio/avrcp.c

index 17d2992..6186187 100644 (file)
@@ -4295,7 +4295,8 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code,
        if (!session->controller || !session->controller->player)
                return FALSE;
 
-       if (!(events & (1 << AVRCP_EVENT_SETTINGS_CHANGED)))
+       if ((session->controller->features & AVRCP_FEATURE_PLAYER_SETTINGS) &&
+                       !(events & (1 << AVRCP_EVENT_SETTINGS_CHANGED)))
                avrcp_list_player_attributes(session);
 
        if (!(events & (1 << AVRCP_EVENT_STATUS_CHANGED)))