summaryrefslogtreecommitdiff
path: root/android/avrcp.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-03-01 16:29:23 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-03-04 11:32:43 +0200
commit611c2ca35c135ad03d1efb6d670b656657fbf84b (patch)
tree47bee142eb2835f7048e7abbb3d9db02e484cb7f /android/avrcp.c
parentb82332a07a946d33bf91f27be8034eb9f72ef392 (diff)
downloadbluez-611c2ca35c135ad03d1efb6d670b656657fbf84b.tar.gz
android/avrcp: Add passthrough handler for fast forward
Fast forward should be send via HAL not handled directly by uinput otherwise Android media player might not interpret it correctly.
Diffstat (limited to 'android/avrcp.c')
-rw-r--r--android/avrcp.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/android/avrcp.c b/android/avrcp.c
index b65f35ca7..6e576d6ca 100644
--- a/android/avrcp.c
+++ b/android/avrcp.c
@@ -301,6 +301,27 @@ static void disconnect_cb(void *data)
avrcp_device_remove(dev);
}
+static bool handle_fast_forward(struct avrcp *session, bool pressed,
+ void *user_data)
+{
+ struct hal_ev_avrcp_passthrough_cmd ev;
+
+ DBG("pressed %s", pressed ? "true" : "false");
+
+ ev.id = AVC_FAST_FORWARD;
+ ev.state = pressed;
+
+ ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP,
+ HAL_EV_AVRCP_PASSTHROUGH_CMD, sizeof(ev), &ev);
+
+ return true;
+}
+
+static const struct avrcp_passthrough_handler passthrough_handlers[] = {
+ { AVC_FAST_FORWARD, handle_fast_forward },
+ { },
+};
+
static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
{
struct avrcp_device *dev;
@@ -350,6 +371,8 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
}
avrcp_set_destroy_cb(dev->session, disconnect_cb, dev);
+ avrcp_set_passthrough_handlers(dev->session, passthrough_handlers,
+ dev);
/* FIXME: get the real name of the device */
avrcp_init_uinput(dev->session, "bluetooth", address);