mako: Add sepolicy for hardware tunables
credits to myfluxi,
https://github.com/CyanogenMod/android_device_lge_hammerhead/commit/d46d2487f65fa6c73a02dda3d78d386c9238449f
Change-Id: Ic697bec0358cde6e622ab569a409fb0894e5ebb4
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 706c98b..bf032cd 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -140,6 +140,7 @@
rmt.te \
sensors.te \
surfaceflinger.te \
+ system_app.te \
system_server.te \
tee.te \
te_macros \
diff --git a/sepolicy/file.te b/sepolicy/file.te
index 9ef5d7a..1107e9f 100644
--- a/sepolicy/file.te
+++ b/sepolicy/file.te
@@ -21,5 +21,6 @@
type sysfs_rmnet, fs_type, sysfs_type;
type sysfs_mpdecision, fs_type, sysfs_type;
+type sysfs_hardware, fs_type, sysfs_type;
type wcnss_ctrl, dev_type;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 4944f75..9685887 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -124,3 +124,8 @@
# Sysfs files used by mpdecision
/sys/module/pm2/modes(/.*)? u:object_r:sysfs_mpdecision:s0
/sys/module/pm_8x60/modes(/.*)? u:object_r:sysfs_mpdecision:s0
+
+# Hardware tunables
+/sys/devices/platform/kcal_ctrl.0(/.*)? -- u:object_r:sysfs_hardware:s0
+/sys/devices/platform/mipi_lgit.1537(/.*)? -- u:object_r:sysfs_hardware:s0
+/sys/class/timed_output/vibrator/amp -- u:object_r:sysfs_hardware:s0
diff --git a/sepolicy/system_app.te b/sepolicy/system_app.te
new file mode 100644
index 0000000..b246f99
--- /dev/null
+++ b/sepolicy/system_app.te
@@ -0,0 +1 @@
+allow system_app sysfs_hardware:file rw_file_perms;