linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fushan Wen <qydwhotmail@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Fushan Wen <qydwhotmail@gmail.com>
Subject: [PATCH BlueZ] Fix missing required properties in MPRIS
Date: Mon,  6 Mar 2023 01:05:51 +0800	[thread overview]
Message-ID: <20230305170551.2572-1-qydwhotmail@gmail.com> (raw)

"SupportedUriSchemes" and "SupportedMimeTypes" are requried properties
in org.mpris.MediaPlayer2. Some MPRIS clients will ignore an MPRIS
interface if the two properties do not exist.

This helps fix https://bugs.kde.org/show_bug.cgi?id=466288
---
 tools/mpris-proxy.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/mpris-proxy.c b/tools/mpris-proxy.c
index e5fc91f..a69b872 100644
--- a/tools/mpris-proxy.c
+++ b/tools/mpris-proxy.c
@@ -1401,6 +1401,18 @@ static gboolean get_tracklist(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean get_emptylist(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	DBusMessageIter array_iter;
+
+	dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+			DBUS_TYPE_STRING_AS_STRING, &array_iter);
+	dbus_message_iter_close_container(iter, &array_iter);
+
+	return TRUE;
+}
+
 static const GDBusPropertyTable mpris_properties[] = {
 	{ "CanQuit", "b", get_disable, NULL, NULL },
 	{ "Fullscreen", "b", get_disable, NULL, NULL },
@@ -1408,6 +1420,8 @@ static const GDBusPropertyTable mpris_properties[] = {
 	{ "CanRaise", "b", get_disable, NULL, NULL },
 	{ "HasTrackList", "b", get_tracklist, NULL, NULL },
 	{ "Identity", "s", get_name, NULL, NULL },
+	{ "SupportedUriSchemes", "as", get_emptylist, NULL, NULL },
+	{ "SupportedMimeTypes", "as", get_emptylist, NULL, NULL },
 	{ }
 };
 
-- 
2.39.2


             reply	other threads:[~2023-03-05 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-05 17:05 Fushan Wen [this message]
2023-03-05 18:07 ` [BlueZ] Fix missing required properties in MPRIS bluez.test.bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230305170551.2572-1-qydwhotmail@gmail.com \
    --to=qydwhotmail@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).