common: Add policy for bluetooth HAL
authorAndreas Schneider <asn@cryptomilk.org>
Sat, 11 Apr 2020 13:16:04 +0000 (15:16 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Sat, 11 Apr 2020 14:37:46 +0000 (16:37 +0200)
Change-Id: Ic2ca2097e9b71d1513f4d508b432e74b0b07a45f

common/vendor/device.te
common/vendor/file_contexts
common/vendor/hal_bluetooth_default.te [new file with mode: 0644]

index 346aa4a43d713f339d82a4cf5f728fb21a731635..24f5a5f38957b934138951eb5c64afc56f830263 100644 (file)
@@ -9,6 +9,7 @@ type radio_block_device, dev_type;
 type sec_efs_block_device, dev_type;
 
 type bbd_device, dev_type;
+type bt_device, dev_type;
 type drb_device, dev_type;
 type epic_device, dev_type;
 type fp_sensor_device, dev_type;
index c95733dbb6682f8756c76902a177ccb05385bbd8..049f2cb30343a9bf7d2e8b65b081d583b89e1848 100644 (file)
@@ -27,6 +27,9 @@
 /dev/batch_io                                u:object_r:io_device:s0
 /dev/ssp_sensorhub                           u:object_r:ssp_device:s0
 
+# bluetooth
+/dev/ttySAC[0-9]                             u:object_r:bt_device:s0
+
 ### epic
 /dev/mode                                    u:object_r:epic_device:s0
 /dev/socket/epic                             u:object_r:epicd_socket:s0
diff --git a/common/vendor/hal_bluetooth_default.te b/common/vendor/hal_bluetooth_default.te
new file mode 100644 (file)
index 0000000..d04de81
--- /dev/null
@@ -0,0 +1,24 @@
+# hal_bluetooth_default.te
+
+# ro.rfkilldisabled
+get_prop(hal_bluetooth_default, rfkilldisabled_prop)
+# vendor.bluetooth_fw_ver
+set_prop(hal_bluetooth_default, wifi_log_prop)
+# sys.bluetooth.tty
+set_prop(hal_bluetooth_default, exported_bluetooth_prop)
+
+# /dev/ttySAC[0-9]
+allow hal_bluetooth_default bt_device:chr_file rw_file_perms;
+
+# /mnt/vendor
+allow hal_bluetooth_default mnt_vendor_file:dir search;
+
+# /mnt/vendor/efs/
+allow hal_bluetooth_default efs_file:dir r_dir_perms;
+
+# /mnt/vendor/conn
+allow hal_bluetooth_default conn_vendor_data_file:dir r_dir_perms;
+allow hal_bluetooth_default conn_vendor_data_file:file r_file_perms;
+
+# /sys/devices/platform/bluetooth/rfkill/rfkill0/state
+allow hal_bluetooth_default sysfs_bt_writable:file rw_file_perms;