diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-12-30 19:28:26 -0800 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2020-01-14 05:41:14 +0000 |
commit | 220caf7c6d346955fe8c87e99cdda73d3f4f5009 (patch) | |
tree | ad27a4dfb9e54522b108417ed91d09775673405f /binding | |
parent | 760bc2d8b646ec3b30a9021ce9de35c4bce59d5e (diff) |
steering-wheel: add event.media.mode functionalityhalibut_8.0.6halibut_8.0.5halibut/8.0.6halibut/8.0.58.0.68.0.5halibut
Allow mode event to switch between AVRCP and local media.
Bug-AGL: SPEC-3047
Change-Id: Id7f697b8608695fd56a57a4f41eafc4c7c31a26d
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding')
-rw-r--r-- | binding/afm-mediaplayer-binding.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); } |