From be70b922efe0dc4727aa323c94e00f61d5b13643 Mon Sep 17 00:00:00 2001 From: Ondrej Hlavac Date: Sat, 25 Mar 2017 11:48:09 +0100 Subject: z2_plus: Fix KeyDisabler - fix path in cmhw - change permissions on boot for sysfs - add selinux rule for sysfs --- cmhw/org/cyanogenmod/hardware/KeyDisabler.java | 2 +- rootdir/etc/init.qcom.rc | 4 ++++ sepolicy/file.te | 1 + sepolicy/file_contexts | 1 + sepolicy/system_server.te | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmhw/org/cyanogenmod/hardware/KeyDisabler.java b/cmhw/org/cyanogenmod/hardware/KeyDisabler.java index 3098af5..125bc32 100644 --- a/cmhw/org/cyanogenmod/hardware/KeyDisabler.java +++ b/cmhw/org/cyanogenmod/hardware/KeyDisabler.java @@ -29,7 +29,7 @@ import org.cyanogenmod.internal.util.FileUtils; public class KeyDisabler { - private static String CONTROL_PATH = "/proc/s1302/virtual_key"; + private static String CONTROL_PATH = "/sys/devices/soc/soc:fpc1020/utouch_disable"; public static boolean isSupported() { return FileUtils.isFileWritable(CONTROL_PATH); diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index fb4dc67..77fc609 100755 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -105,6 +105,10 @@ on boot chown root system /proc/tri-state-key/keyCode_bottom chmod 0660 /proc/tri-state-key/keyCode_bottom + # U-Touch disable - KeyDisabler + chown system system /sys/devices/soc/soc:fpc1020/utouch_disable + chmod 0660 /sys/devices/soc/soc:fpc1020/utouch_disable + # Graphics chown system graphics /sys/class/graphics/fb0/dyn_pu chmod 0664 /sys/class/graphics/fb0/dyn_pu diff --git a/sepolicy/file.te b/sepolicy/file.te index 27942cb..1ba40c1 100644 --- a/sepolicy/file.te +++ b/sepolicy/file.te @@ -2,6 +2,7 @@ type fpc_data_file, file_type; type fpc_images_file, file_type; type sysfs_fpc_irq, sysfs_type, fs_type; type sysfs_fpc_proximity, sysfs_type, fs_type; +type sysfs_fpc_utouch_disable, fs_type, sysfs_type; type proc_touchpanel, fs_type; type nv_data_file, file_type; type proc_stat, fs_type; diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 844cbaf..979f833 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -14,6 +14,7 @@ /data/fpc_images(/.*)? u:object_r:fpc_images_file:s0 /sys/devices/soc/soc:fpc_fpc1020/irq u:object_r:sysfs_fpc_irq:s0 /sys/devices/soc/soc:fpc_fpc1020/proximity_state u:object_r:sysfs_fpc_proximity:s0 +/sys/devices/soc/soc:fpc1020/utouch_disable u:object_r:sysfs_fpc_utouch_disable:s0 /dev/dash u:object_r:input_device:s0 /sys/devices/soc/.*ssusb/power_supply/usb(/.*)? u:object_r:sysfs_usb_supply:s0 diff --git a/sepolicy/system_server.te b/sepolicy/system_server.te index e9c07c8..64cdc0a 100644 --- a/sepolicy/system_server.te +++ b/sepolicy/system_server.te @@ -5,6 +5,7 @@ allow system_server sensors_persist_file:file r_file_perms; allow system_server sensors_persist_file:dir search; allow system_server proc_stat:file r_file_perms; allow system_server unlabeled:file unlink; +allow system_server sysfs_fpc_utouch_disable:file rw_file_perms; get_prop(system_server, diag_prop); allow system_server diag_device:chr_file { read write }; allow system_server drmserver:process setsched; -- cgit v1.2.3