blob: 83a55916e5946522a6e1ffea9842da74407062a1 [file] [log] [blame]
Shawn Shin9b5762b2017-05-04 22:49:13 -07001# Copyright (c) 2017, The Linux Foundation. All rights reserved.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met:
6# * Redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer.
8# * Redistributions in binary form must reproduce the above
9# copyright notice, this list of conditions and the following
10# disclaimer in the documentation and/or other materials provided
11# with the distribution.
12# * Neither the name of The Linux Foundation nor the names of its
13# contributors may be used to endorse or promote products derived
14# from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
Choong Lee0dbe2eb2017-07-19 12:22:04 -070028type qdmastatsd, domain, mlstrustedsubject;
Shawn Shin9b5762b2017-05-04 22:49:13 -070029type qdmastatsd_exec, file_type, vendor_file_type, exec_type;
30
31init_daemon_domain(qdmastatsd)
32
33allow qdmastatsd qdma_data_file:file create_file_perms;
34allow qdmastatsd qdma_data_file:dir create_dir_perms;
35
Shawn Shina61c1d72018-01-04 10:29:00 -080036# access to /dev/ramdump_microdump_modem
37allow qdmastatsd ramdump_device:chr_file r_file_perms;
38
Shawn Shin9b5762b2017-05-04 22:49:13 -070039# access to /sys/class/power_supply/bms/charge_counter
40# access to /sys/class/power_supply/battery/capacity
41# access to /sys/class/power_supply/battery/status
42allow qdmastatsd sysfs_battery_supply:{file lnk_file} r_file_perms;
43allow qdmastatsd sysfs_battery_supply:dir r_dir_perms;
44
45# /sys/class/kgsl/kgsl-3d0/gpu_busy_percentage
46# /sys/class/kgsl/kgsl-3d0/gpuclk
47# /sys/class/kgsl/kgsl-3d0/gpu_clock_stats
48# /sys/class/kgsl/kgsl-3d0/num_pwrlevels
49# /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies
50allow qdmastatsd sysfs_kgsl:{file lnk_file} r_file_perms;
51allow qdmastatsd sysfs_kgsl:dir r_dir_perms;
52
53# /sys/class/leds/lcd-backlight/brightness
Choong Leea1eb7ca2017-07-10 12:10:34 -070054allow qdmastatsd sysfs_leds:{file lnk_file} r_file_perms;
55allow qdmastatsd sysfs_leds:dir r_dir_perms;
Shawn Shin9b5762b2017-05-04 22:49:13 -070056allow qdmastatsd sysfs_graphics:{file lnk_file} r_file_perms;
57allow qdmastatsd sysfs_graphics:dir r_dir_perms;
58
59# access to /sys/devices/system/cpu/possible
60allow qdmastatsd sysfs_devices_system_cpu:file r_file_perms;
61allow qdmastatsd sysfs_devices_system_cpu:dir r_dir_perms;
62
63# access to /sys/module/lpm_stats/cpu%d/total_sleep_time_secs
64#allow qdmastatsd sysfs_lpm_stats:{file lnk_file} r_file_perms;
65#allow qdmastatsd sysfs_lpm_stats:dir r_dir_perms;
66
67# access to /sys/class/thermal/thermal_zone%d
68allow qdmastatsd sysfs_thermal:{file lnk_file} r_file_perms;
69allow qdmastatsd sysfs_thermal:dir r_dir_perms;
70
71# access to /sys/power/wake_lock, wake_unlock
72allow qdmastatsd sysfs_wake_lock:file r_file_perms;
73allow qdmastatsd sysfs_wake_lock:dir r_dir_perms;
74
75# access to /proc/stat
76allow qdmastatsd proc_stat:file r_file_perms;
77allow qdmastatsd proc_stat:dir r_dir_perms;
78
79# access to /proc/net/xt_qtaguid/stats
80allow qdmastatsd proc_net:file r_file_perms;
81allow qdmastatsd proc_net:dir r_dir_perms;
82
Choong Lee0dbe2eb2017-07-19 12:22:04 -070083# access to /proc/<pid>/
84r_dir_file(qdmastatsd, domain);
85
86# qmi
87qmux_socket(qdmastatsd);
88allow qdmastatsd self:socket create_socket_perms;
89allowxperm qdmastatsd self:socket ioctl msm_sock_ipc_ioctls;
90
Shawn Shini3d4536a2017-08-14 16:25:22 -070091# diag
92userdebug_or_eng(`
93 diag_use(qdmastatsd)
94')
95
Shawn Shin9b5762b2017-05-04 22:49:13 -070096# for dmesg
97#read_logd(qdmastatsd);
Shawn Shina5656282017-11-08 15:20:25 -080098
99# allow qdma_prop
100set_prop(qdmastatsd, qdma_prop);