summaryrefslogtreecommitdiff
path: root/power-libperfmgr/hal_power_default.te
blob: b4d4f655e9debf4e4a71869a17acc03cc23cfdc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
typeattribute hal_power_default mlstrustedsubject;

allow hal_power_default sysfs_devices_system_cpu:file rw_file_perms;
allow hal_power_default latency_device:chr_file rw_file_perms;
allow hal_power_default cgroup:file r_file_perms;

# To get/set powerhal state property
set_prop(hal_power_default, vendor_power_prop)

# Rule for hal_power_default to access graphics composer process
unix_socket_connect(hal_power_default, pps, hal_graphics_composer_default);

# Set scheduling info for apps (for adpf)
allow hal_power_default appdomain:process { getsched setsched };
allow hal_power_default self:capability sys_nice;

# Set scheduling info for surfaceflinger (for adpf)
allow hal_power_default surfaceflinger:process setsched;

# Set scheduling info for HWC (for adpf)
allow hal_power_default hal_graphics_composer_default:process setsched;

# Set scheduling info for system_server (for adpf)
allow hal_power_default system_server:process setsched;

# Allow reading proc files for CPU statistics.
allow hal_power_default proc_stat:file r_file_perms;
allow hal_power_default proc_vendor_sched:dir r_dir_perms;
allow hal_power_default proc_vendor_sched:file r_file_perms;

# Allow read/write thermal sysfs
allow hal_power_default thermal_link_device:dir r_dir_perms;
allow hal_power_default sysfs_thermal:dir r_dir_perms;
allow hal_power_default sysfs_thermal:file rw_file_perms;
allow hal_power_default sysfs_thermal:lnk_file r_file_perms;

userdebug_or_eng(`
# Allow reading /data/vendor/* for debugging
  allow hal_power_default vendor_data_file:file r_file_perms;
')