From c455c0b51cc06901e9afc168cf5afc6503f32e12 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Wed, 27 Mar 2019 18:25:47 -0700 Subject: binding: bluetooth: allow multiple paths for org.bluez.MediaPlayer1 interfaces Previously org.bluez.MediaPlayer1 paths could only resolve to player0 but certain phones request another instance for another application (e.g. player1). This patchset changes the default media player path to last connected, and which in theory should be from the media application in use on the phone. From limited experiments not in use interfaces will be reaped shortly after going idle. Bug-AGL: SPEC-2281 Change-Id: Id4bdc89cd395d5cd3ac043394761a95b306e5c6d Signed-off-by: Matt Ranostay --- binding/bluetooth-api.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'binding/bluetooth-api.h') diff --git a/binding/bluetooth-api.h b/binding/bluetooth-api.h index 6b24d13..a0b807b 100644 --- a/binding/bluetooth-api.h +++ b/binding/bluetooth-api.h @@ -116,9 +116,9 @@ static inline gboolean is_mediaplayer1_interface(const char *path) if (split_length(path) != 6) return FALSE; - // TODO: allow mutiple players per device + // Check for 'playerX' suffix, not always player0 data = find_index(path, 5); - ret = !g_strcmp0(data, BLUEZ_DEFAULT_PLAYER); + ret = !strncmp(data, BLUEZ_DEFAULT_PLAYER, sizeof(BLUEZ_DEFAULT_PLAYER) - 1); g_free(data); return ret; -- cgit 1.2.3-korg