From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v2 1/2] android/avrcp: Fill attributes in case of empty for GetElementAttributes
Date: Mon, 10 Mar 2014 11:33:07 +0200 [thread overview]
Message-ID: <1394443988-6004-1-git-send-email-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This has to be done since Android do not interpret empty list as get all
attributes as it should.
---
v2: Move empty list handling to daemon side and fix starting with attribute
0x00 which is illegal.
android/avrcp.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/android/avrcp.c b/android/avrcp.c
index e26ddf2..b9085e6 100644
--- a/android/avrcp.c
+++ b/android/avrcp.c
@@ -655,11 +655,22 @@ static ssize_t handle_get_element_attrs_cmd(struct avrcp *session,
return -EINVAL;
params += 9;
+
+ /* Set everything in case of empty list */
+ if (ev->number == 0) {
+ for (i = 0; i < HAL_AVRCP_MEDIA_ATTR_DURATION; i++)
+ /* Skip 0x00 as the attributes start with 0x01 */
+ ev->attrs[i] = i + 1;
+ ev->number = i;
+ goto done;
+ }
+
for (i = 0; i < ev->number; i++) {
ev->attrs[i] = bt_get_be32(params);
params += 4;
}
+done:
ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP,
HAL_EV_AVRCP_GET_ELEMENT_ATTRS,
sizeof(*ev) + ev->number, ev);
--
1.8.5.3
next reply other threads:[~2014-03-10 9:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-10 9:33 Luiz Augusto von Dentz [this message]
2014-03-10 9:33 ` [PATCH v2 2/2] android/avrcp: Fix not handling SetAbsoluteVolume response Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394443988-6004-1-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox