summaryrefslogtreecommitdiff
path: root/android/init.bluetooth.rc
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2014-01-17 16:30:41 +0100
committerSzymon Janc <szymon.janc@gmail.com>2014-01-17 20:41:45 +0100
commit72c77073a44a2452e130fc2ca9f15dcd2256c656 (patch)
tree0bebcece2085fce9ffcb9ac81234a3996ae1a343 /android/init.bluetooth.rc
parent23b2191c07021fb09002967d729c678d1ba58258 (diff)
downloadbluez-72c77073a44a2452e130fc2ca9f15dcd2256c656.tar.gz
android: Add sample init.bluetooth.rc file
This file is intended to be included from device init.rc.
Diffstat (limited to 'android/init.bluetooth.rc')
-rw-r--r--android/init.bluetooth.rc37
1 files changed, 37 insertions, 0 deletions
diff --git a/android/init.bluetooth.rc b/android/init.bluetooth.rc
new file mode 100644
index 000000000..8be869af0
--- /dev/null
+++ b/android/init.bluetooth.rc
@@ -0,0 +1,37 @@
+# required permissions
+on boot
+ chown bluetooth bluetooth /data/misc/bluetooth
+ chown bluetooth bluetooth /dev/uhid
+
+# services
+on property:bluetooth.start=daemon
+ setprop bluetooth.start none
+ start bluetoothd
+
+on property:bluetooth.stop=daemon
+ setprop bluetooth.stop none
+ stop bluetoothd
+
+on property:bluetooth.start=snoop
+ setprop bluetooth.start none
+ start bluetoothd-snoop
+
+on property:bluetooth.stop=snoop
+ setprop bluetooth.stop none
+ stop bluetoothd-snoop
+
+service bluetoothd /system/bin/logwrapper /system/bin/bluetoothd
+ class main
+ # init does not yet support setting capabilities so run as root,
+ # bluetoothd drop uid to bluetooth with the right linux capabilities
+ group bluetooth
+ disabled
+ oneshot
+
+service bluetoothd-snoop /system/bin/logwrapper /system/bin/bluetoothd-snoop
+ class main
+ # init does not yet support setting capabilities so run as root,
+ # bluetoothd-snoop drops unneeded linux capabilities
+ group nobody
+ disabled
+ oneshot