Diff between 4ed6c1c2a4a06a40d358fd101faa1743e5e10be9 and af0659ba5f02764c79dd5b9a2f1d9031dd19af63

Changed Files

File Additions Deletions Status
test/mpris-player.c +20 -0 modified

Full Patch

diff --git a/test/mpris-player.c b/test/mpris-player.c
index 4592e5d..a1632f3 100644
--- a/test/mpris-player.c
+++ b/test/mpris-player.c
@@ -429,6 +429,22 @@ static char *sender2path(const char *sender)
 	return g_strdelimit(path, ":.", '_');
 }
 
+static DBusHandlerResult player_message(DBusConnection *conn,
+						DBusMessage *msg, void *data)
+{
+	if (dbus_message_is_method_call(msg, "org.bluez.MediaPlayer",
+								"Release")) {
+		printf("Release\n");
+		exit(1);
+	}
+
+	return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+static const DBusObjectPathVTable player_table = {
+	.message_function = player_message,
+};
+
 static void add_player(DBusConnection *conn, const char *name,
 							const char *sender)
 {
@@ -492,6 +508,10 @@ static void add_player(DBusConnection *conn, const char *name,
 		goto done;
 	}
 
+	if (!dbus_connection_register_object_path(sys, path, &player_table,
+								NULL))
+		fprintf(stderr, "Can't register object path for agent\n");
+
 done:
 	if (reply)
 		dbus_message_unref(reply);