1# Policy for sensor daemon
2type sensors, domain;
3type sensors_exec, exec_type, vendor_file_type, file_type;
4
5init_daemon_domain(sensors)
6
7allow sensors self:capability {
8    setuid
9    setgid
10    net_bind_service
11};
12
13allow sensors self:socket create_socket_perms;
14allowxperm sensors self:socket ioctl msm_sock_ipc_ioctls;
15
16allow sensors persist_sensors_file:dir rw_dir_perms;
17allow sensors persist_sensors_file:file create_file_perms;
18allow sensors mnt_vendor_file:dir { getattr search };
19allow sensors persist_file:dir search;
20
21allow sensors system_file:dir r_dir_perms;
22allow sensors sensors_device:chr_file rw_file_perms;
23
24# sensor direct mode
25allow sensors qdsp_device:chr_file ioctl;
26
27allow sensors sysfs_soc:dir search;
28allow sensors sysfs_soc:file r_file_perms;
29r_dir_file(sensors, sysfs_msm_subsys)
30
31allow sensors ion_device:chr_file r_file_perms;
32allow sensors qdsp_device:chr_file r_file_perms;
33
34# Allow to getprop persist.vendor.sys.modem.diag.mdlog
35get_prop(sensors, vendor_modem_diag_prop)
36
37# Allow to read /sys/class/power_supply/usb/input_current_now
38r_dir_file(sensors, sysfs_batteryinfo)
39
40# For reading dir/files on /dsp
41r_dir_file(sensors, adsprpcd_file)
42
43dontaudit sensors kernel:system module_request;
44