From 5c85eb1ae7c637471b6091c7694843f63d3e4f97 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Mon, 30 Dec 2019 19:28:26 -0800 Subject: steering-wheel: add event.media.mode functionality Allow mode event to switch between AVRCP and local media. Bug-AGL: SPEC-3047 Change-Id: Id7f697b8608695fd56a57a4f41eafc4c7c31a26d Signed-off-by: Matt Ranostay --- binding/afm-mediaplayer-binding.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c index b0ee725..2a66afb 100644 --- a/binding/afm-mediaplayer-binding.c +++ b/binding/afm-mediaplayer-binding.c @@ -1037,6 +1037,8 @@ static void onevent(afb_api_t api, const char *event, struct json_object *object #else mediaplayer_set_role_state(api, GST_STATE_PAUSED); #endif + // Local media playback cannot be corked at this point if it's stopped + data.corked = FALSE; } else { json_object *jresp = populate_json_metadata(); @@ -1110,7 +1112,9 @@ static void onevent(afb_api_t api, const char *event, struct json_object *object afb_event_push(metadata_event, object); } } else if (!strcmp(uid, "event.media.mode")) { - // Do nothing ATM + g_mutex_lock(&mutex); + avrcp_cmd(api, data.avrcp_connected ? "disconnect" : "connect"); + g_mutex_unlock(&mutex); } else { AFB_WARNING("Unhandled signal-composer uid '%s'", uid); } -- cgit 1.2.3-korg