summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavid <davidteri91@gmail.com>2015-01-05 01:48:13 +0100
committerChirayu Desai <chirayudesai1@gmail.com>2015-01-15 20:15:49 +0530
commitd74db9dff85e1e4ca84f33ecebf0df7c5010d0c0 (patch)
tree6354c8768cec575e47af620f41d5dc8576d69c8f
parent88d2d26fac8da11dd25464b8d8bd852e1b03470a (diff)
Add SELinux policy for hardware tunables
Change-Id: Ie58527ef6ca5b9aed48e68d0ec74a6453b3b4643
-rw-r--r--BoardConfigCommon.mk4
-rw-r--r--sepolicy/file.te2
-rw-r--r--sepolicy/file_contexts4
-rw-r--r--sepolicy/system_app.te1
4 files changed, 7 insertions, 4 deletions
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index e77f611..754bc91 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -61,10 +61,6 @@ TARGET_INIT_VENDOR_LIB := libinit_shinano
BOARD_SEPOLICY_DIRS += \
device/sony/shinano-common/sepolicy
-# The list below is order dependent
-BOARD_SEPOLICY_UNION += \
- file_contexts
-
# Wifi
WPA_SUPPLICANT_VERSION := VER_0_8_X
BOARD_WLAN_DEVICE := bcmdhd
diff --git a/sepolicy/file.te b/sepolicy/file.te
new file mode 100644
index 0000000..a05ee0d
--- /dev/null
+++ b/sepolicy/file.te
@@ -0,0 +1,2 @@
+type sysfs_display, fs_type, sysfs_type;
+type sysfs_vibrator, fs_type, sysfs_type;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index b9b73f0..01b7557 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -3,3 +3,7 @@
# Audio
/dev/tfa98xx u:object_r:audio_device:s0
+
+# Hardware tunables
+/sys/devices/mdss_dsi_panel/cabc -- u:object_r:sysfs_display:s0
+/sys/devices/virtual/timed_output/vibrator/vtg_level -- u:object_r:sysfs_vibrator:s0
diff --git a/sepolicy/system_app.te b/sepolicy/system_app.te
new file mode 100644
index 0000000..20fc2aa
--- /dev/null
+++ b/sepolicy/system_app.te
@@ -0,0 +1 @@
+allow system_app { sysfs_display sysfs_vibrator }:file rw_file_perms;