Add selinux policy for Bluetooth HAL
Bug: 31972505
Test: VTS test passes, Bluetooth starts/stops
Change-Id: Ic068c9fca7c50e63c5b6e3d86a2ee6cc53207e08
diff --git a/private/file_contexts b/private/file_contexts
index 3fc8129..0b81d4c 100644
--- a/private/file_contexts
+++ b/private/file_contexts
@@ -235,6 +235,7 @@
/system/fake-lib(64)?/libart.* u:object_r:libart_file:s0
/system/lib(64)?/libart.* u:object_r:libart_file:s0
/system/bin/hw/android\.hardware\.audio@2\.0-service u:object_r:hal_audio_default_exec:s0
+/system/bin/hw/android\.hardware\.bluetooth@1\.0-service u:object_r:hal_bluetooth_default_exec:s0
/system/bin/hw/android\.hardware\.boot@1\.0-service u:object_r:hal_boot_exec:s0
/system/bin/hw/android\.hardware\.contexthub@1\.0-service u:object_r:hal_contexthub_default_exec:s0
/system/bin/hw/android\.hardware\.dumpstate@1\.0-service u:object_r:hal_dumpstate_default_exec:s0
diff --git a/private/hal_bluetooth_default.te b/private/hal_bluetooth_default.te
new file mode 100644
index 0000000..f77410c
--- /dev/null
+++ b/private/hal_bluetooth_default.te
@@ -0,0 +1,9 @@
+type hal_bluetooth_default, hal_bluetooth, domain;
+type hal_bluetooth_default_exec, exec_type, file_type;
+
+init_daemon_domain(hal_bluetooth_default)
+
+# VTS tests need to be able to toggle rfkill
+userdebug_or_eng(`
+ allow hal_bluetooth_default self:capability net_admin;
+')