diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 639ea9f2..159f3b5e 100755 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -269,6 +269,19 @@ on boot # Create pa-cal driver directory lct-20180914 mkdir /mnt/vendor/persist/audio 0770 root root + # zhitongze@huaqin.com add sensor hardware info 20180207 begin + chmod 0664 /sys/devices/platform/HardwareInfo/gsensor + chmod 0664 /sys/devices/platform/HardwareInfo/msensor + chmod 0664 /sys/devices/platform/HardwareInfo/alsps + chmod 0664 /sys/devices/platform/HardwareInfo/gyro + # zhitongze@huaqin.com add sensor hardware info 20180207 end + chown system system /sys/devices/platform/HardwareInfo/alsps + chown system system /sys/devices/platform/HardwareInfo/gsensor + chown system system /sys/devices/platform/HardwareInfo/msensor + chown system system /sys/devices/platform/HardwareInfo/gyro + chown system system /sys/devices/platform/HardwareInfo/sar_sensor_1 + chown system system /sys/devices/platform/HardwareInfo/sar_sensor_2 + # msm specific files that need to be created on /data on post-fs-data mkdir /data/vendor/misc 01771 system system diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te index c3d165a4..4cec4141 100644 --- a/sepolicy/vendor/file.te +++ b/sepolicy/vendor/file.te @@ -2,6 +2,7 @@ type ir_dev_file, file_type; type proc_dt2w, fs_type, proc_type; type fingerprint_data_file, file_type, data_file_type, core_data_file_type; type fingerprint_sysfs, fs_type, sysfs_type; +type sysfs_info, fs_type, sysfs_type; allow ueventd ir_dev_file:chr_file { create setattr }; diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 94b5e6b7..4cc11155 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -18,6 +18,10 @@ # HVDCP /sys/devices(/platform)?/soc/[a-z0-9]+\.i2c/i2c-[0-9]+/[0-9]+-[a-z0-9]+/[a-z0-9]+\.i2c:qcom,[a-z0-9]+@[a-z0-9]:qcom,smb[a-z0-9]+-parallel-slave@[0-9]+/power_supply/parallel(/.*)? u:object_r:sysfs_usb_supply:s0 +# HW Info +/sys/devices/platform/HardwareInfo(/.*)? u:object_r:sysfs_info:s0 +/sys/devices/platform/HardwareInfo/gsensor u:object_r:sysfs_info:s0 + # IR /dev/spidev7.1 u:object_r:spidev_device:s0 diff --git a/sepolicy/vendor/hal_audio_default.te b/sepolicy/vendor/hal_audio_default.te new file mode 100644 index 00000000..4a615fe9 --- /dev/null +++ b/sepolicy/vendor/hal_audio_default.te @@ -0,0 +1 @@ +allow hal_audio_default sysfs_info:file { open getattr read }; diff --git a/sepolicy/vendor/hal_sensors_default.te b/sepolicy/vendor/hal_sensors_default.te index 28414f9c..c2045f3d 100644 --- a/sepolicy/vendor/hal_sensors_default.te +++ b/sepolicy/vendor/hal_sensors_default.te @@ -1 +1,2 @@ allow hal_sensors_default sysfs:file { read open }; +allow hal_sensors_default sysfs_info:file { read write }; diff --git a/sepolicy/vendor/init.te b/sepolicy/vendor/init.te index 0e97b5ff..afc56b59 100644 --- a/sepolicy/vendor/init.te +++ b/sepolicy/vendor/init.te @@ -5,3 +5,5 @@ allow init property_socket:sock_file write; allow init sysfs_dm:file { open write }; allow init tee_device:chr_file { write ioctl }; allow init vendor_default_prop:property_service set; +allow init sysfs_info:file { open read }; +allow init sysfs:file setattr;