summaryrefslogtreecommitdiff
path: root/android/avrcp.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-03-01 16:48:34 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-03-04 11:32:43 +0200
commit44019b88c6827e7a92af145b92b5cd333531a16d (patch)
tree188631e3b999729a3b869a050a3921b38b170354 /android/avrcp.c
parent611c2ca35c135ad03d1efb6d670b656657fbf84b (diff)
downloadbluez-44019b88c6827e7a92af145b92b5cd333531a16d.tar.gz
android/avrcp: Add passthrough handler for rewind
Rewind 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.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/android/avrcp.c b/android/avrcp.c
index 6e576d6ca..0db2b43c9 100644
--- a/android/avrcp.c
+++ b/android/avrcp.c
@@ -317,8 +317,25 @@ static bool handle_fast_forward(struct avrcp *session, bool pressed,
return true;
}
+static bool handle_rewind(struct avrcp *session, bool pressed,
+ void *user_data)
+{
+ struct hal_ev_avrcp_passthrough_cmd ev;
+
+ DBG("pressed %s", pressed ? "true" : "false");
+
+ ev.id = AVC_REWIND;
+ 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 },
+ { AVC_REWIND, handle_rewind },
{ },
};