diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 3323b1d3..4cfecac9 100755 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -119,6 +119,19 @@ static void getModemLogs(int fd) } } +static void DumpTouch(int fd) { + if (!access("/sys/android_touch", R_OK)) { + DumpFileToFd(fd, "Synaptics touch firmware version", + "/sys/android_touch/vendor"); + DumpFileToFd(fd, "Synaptics touch firmware config", + "/sys/android_touch/config"); + } + if (!access("/sys/class/input/ftm4_touch", R_OK)) { + DumpFileToFd(fd, "STM touch firmware config", + "/sys/class/input/ftm4_touch/version"); + } +} + } // unnamed namespace @@ -155,6 +168,7 @@ Return DumpstateDevice::dumpstateBoard(const hidl_handle& handle) { DumpFileToFd(fd, "PD Engine", "/d/pd_engine/usbpd0"); DumpFileToFd(fd, "smblib-usb logs", "/d/ipc_logging/smblib/log"); DumpFileToFd(fd, "ipc-local-ports", "/d/msm_ipc_router/dump_local_ports"); + DumpTouch(fd); /* Check if qsee_logger tool exists */ if (!access("/vendor/bin/qsee_logger", X_OK)) { diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te index 79d37718..792ab3c7 100644 --- a/sepolicy/vendor/file.te +++ b/sepolicy/vendor/file.te @@ -10,6 +10,7 @@ type sysfs_net, sysfs_type, fs_type; type sysfs_rmtfs, sysfs_type, fs_type; type sysfs_soc, sysfs_type, fs_type; type sysfs_timestamp_switch, sysfs_type, fs_type; +type sysfs_touch, sysfs_type, fs_type; type sysfs_usb_c, sysfs_type, fs_type; type debugfs_clk, debugfs_type, fs_type; diff --git a/sepolicy/vendor/genfs_contexts b/sepolicy/vendor/genfs_contexts index 3fe84319..634e4e69 100644 --- a/sepolicy/vendor/genfs_contexts +++ b/sepolicy/vendor/genfs_contexts @@ -7,6 +7,8 @@ genfscon sysfs /devices/soc/soc:qcom,mincpubw u:object_r:sysfs_msm_subsy genfscon sysfs /class/devfreq u:object_r:sysfs_msm_subsys:s0 genfscon sysfs /devices/soc/soc:qcom,memlat-cpu0 u:object_r:sysfs_msm_subsys:s0 genfscon sysfs /devices/soc/soc:qcom,memlat-cpu4 u:object_r:sysfs_msm_subsys:s0 +genfscon sysfs /android_touch u:object_r:sysfs_touch:s0 +genfscon sysfs /devices/virtual/input/ftm4_touch u:object_r:sysfs_touch:s0 genfscon sysfs /class/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0 diff --git a/sepolicy/vendor/hal_dumpstate_impl.te b/sepolicy/vendor/hal_dumpstate_impl.te index 075aa732..3118fcff 100644 --- a/sepolicy/vendor/hal_dumpstate_impl.te +++ b/sepolicy/vendor/hal_dumpstate_impl.te @@ -49,3 +49,7 @@ userdebug_or_eng(`allow hal_dumpstate_impl debugfs_usb:file r_file_perms;') #Access display debug data allow hal_dumpstate_impl display_vendor_data_file:dir r_dir_perms; allow hal_dumpstate_impl display_vendor_data_file:file r_file_perms; + +# Access to touch firmware info +allow hal_dumpstate_impl sysfs_touch:dir r_dir_perms; +allow hal_dumpstate_impl sysfs_touch:file r_file_perms;