I’m working on an snap that registers to receive and handle PropertiesChanged events from Spotify over the mpris DBus interface. The app inspects and processes track metadata as tracks are played and skipped by the user in Spotify. I believe this is the last hurdle to overcome before my snap can finally work in strict confinement. I am hoping someone can help me out.
The mpris plug is in place and connected. And the snap is able to access Spotify’s mpris interface without any problems:
$ snap connections testapp Interface Plug Slot Notes audio-playback testapp:audio-playback :audio-playback - desktop testapp:desktop :desktop - mpris testapp:mpris spotify:spotify-mpris manual
… except receive PropertiesChanged events as reported in the logs:
dbus-daemon: apparmor="DENIED" operation="dbus_signal" bus="session" path="/org/mpris/MediaPlayer2" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.179" mask="receive" pid=363757 label="snap.testapp.testapp" peer_pid=10453 peer_label="snap.spotify.spotify"
Looking at interfaces/builtin/mpris.go, I only see (send) policies for PropertiesChanged:
dbus (send) bus=session interface=org.freedesktop.DBus.Properties path=/org/mpris/MediaPlayer2 member=PropertiesChanged peer=(label=###PLUG_SECURITY_TAGS###),
Would it be possible for the mpris interface to allow snaps to receive PropertiesChanged events? My problem seems similar to the one reported in the following link, but for (receive) rather than (send): Error trying to comunicate with Spotify via DBus