bluez5: add interface access for MediaPlayer application 25/9125/2
authorMatt Ranostay <matt.ranostay@konsulko.com>
Mon, 17 Apr 2017 07:34:13 +0000 (07:34 +0000)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Thu, 20 Apr 2017 09:40:50 +0000 (09:40 +0000)
MediaPlayer needs to receive a few signals from org.bluez to trigger
various AVRCP metadata and position data.

Change-Id: I5b54f91dc5654d2e0208ae564de2440dc6bd5f48
AGL-Bug: SPEC-541
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/9125
Tested-by: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
ci-image-build: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
Reviewed-by: José Bollo <jobol@nonadev.net>
Reviewed-by: Stéphane Desneux <stephane.desneux@iot.bzh>
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Reviewed-by: Matt Porter <mporter@konsulko.com>
meta-agl/recipes-connectivity/bluez5/bluez5.inc
meta-agl/recipes-connectivity/bluez5/bluez5/bluetooth.conf [new file with mode: 0644]

index 8189dc8..5869a17 100644 (file)
@@ -23,6 +23,7 @@ SRC_URI = "\
     file://run-ptest \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
     file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
+    file://bluetooth.conf \
 "
 SRCREV = "c64b4d9e8dc3e36672061f39a9dba19ad0fb1ef1"
 S = "${WORKDIR}/git"
@@ -62,6 +63,8 @@ do_install_append() {
            install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/
        fi
 
+        install -m 0644 ${WORKDIR}/bluetooth.conf ${D}${sysconfdir}/dbus-1/system.d/bluetooth.conf
+
   if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then
     sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}/${sysconfdir}/init.d/bluetooth
   fi
diff --git a/meta-agl/recipes-connectivity/bluez5/bluez5/bluetooth.conf b/meta-agl/recipes-connectivity/bluez5/bluez5/bluetooth.conf
new file mode 100644 (file)
index 0000000..8e2204b
--- /dev/null
@@ -0,0 +1,39 @@
+<!-- This configuration file specifies the required security policies
+     for Bluetooth core daemon to work. -->
+
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+  <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+  <policy user="root">
+    <allow own="org.bluez"/>
+    <allow send_destination="org.bluez"/>
+    <allow send_interface="org.bluez.Agent1"/>
+    <allow send_interface="org.bluez.MediaEndpoint1"/>
+    <allow send_interface="org.bluez.MediaPlayer1"/>
+    <allow send_interface="org.bluez.ThermometerWatcher1"/>
+    <allow send_interface="org.bluez.AlertAgent1"/>
+    <allow send_interface="org.bluez.Profile1"/>
+    <allow send_interface="org.bluez.HeartRateWatcher1"/>
+    <allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
+    <allow send_interface="org.bluez.GattCharacteristic1"/>
+    <allow send_interface="org.bluez.GattDescriptor1"/>
+    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
+    <allow send_interface="org.freedesktop.DBus.Properties"/>
+    <allow receive_type="signal" receive_sender="org.bluez" receive_interface="org.freedesktop.DBus.Properties"/>
+    <allow receive_type="signal" receive_sender="org.bluez" receive_interface="org.freedesktop.DBus.ObjectManager"/>
+  </policy>
+
+  <policy at_console="true">
+    <allow send_destination="org.bluez"/>
+  </policy>
+
+  <!-- allow users of lp group (printing subsystem) to 
+       communicate with bluetoothd -->
+  <policy group="lp">
+    <allow send_destination="org.bluez"/>
+  </policy>
+
+</busconfig>