1 # read and write factory calibration and sensor configuration data 2 allow hal_sensors_default mnt_vendor_file:dir search; 3 allow hal_sensors_default persist_file:dir search; 4 r_dir_file(hal_sensors_default, persist_sensors_file) 5 allow hal_sensors_default persist_sensors_file:dir create_dir_perms; 6 allow hal_sensors_default persist_sensors_file:file create_file_perms; 7 8 # interact with the sensors low power island (SLPI) CPU 9 allow hal_sensors_default self:socket { create ioctl read write }; 10 allowxperm hal_sensors_default self:socket ioctl msm_sock_ipc_ioctls; 11 r_dir_file(hal_sensors_default, sysfs_msm_subsys); 12 13 allow hal_sensors_default qdsp_device:chr_file r_file_perms; 14 15 userdebug_or_eng(` 16 allow hal_sensors_default diag_device:chr_file rw_file_perms; 17 ') 18 19 allow hal_sensors_default sensors_vendor_data_file:dir create_dir_perms; 20 allow hal_sensors_default sensors_vendor_data_file:file create_file_perms; 21 22 # needed by elmyra_raw.cpp 23 allow hal_sensors_default chre:unix_stream_socket connectto; 24 allow hal_sensors_default chre_socket:sock_file write; 25 26 dontaudit hal_sensors_default kernel:system module_request; 27 28 # Allow to read /sys/class/power_supply/usb/input_current_now 29 r_dir_file(hal_sensors_default, sysfs_batteryinfo) 30 31 r_dir_file(hal_sensors_default, adsprpcd_file) 32