1# Car watchdog server.
2typeattribute carwatchdogd coredomain;
3typeattribute carwatchdogd mlstrustedsubject;
4
5type carwatchdogd_exec, exec_type, file_type, system_file_type;
6
7init_daemon_domain(carwatchdogd)
8add_service(carwatchdogd, carwatchdogd_service)
9binder_use(carwatchdogd)
10binder_service(carwatchdogd)
11
12# Configration to communicate with VHAL.
13hwbinder_use(carwatchdogd)
14get_prop(carwatchdogd, hwservicemanager_prop)
15hal_client_domain(carwatchdogd, hal_vehicle)
16
17# Scan through /proc/pid for all processes.
18r_dir_file(carwatchdogd, domain)
19
20# Read /proc/uid_io/stats.
21allow carwatchdogd proc_uid_io_stats:file r_file_perms;
22
23# Read /proc/stat file.
24allow carwatchdogd proc_stat:file r_file_perms;
25
26# Read /proc/diskstats file.
27allow carwatchdogd proc_diskstats:file r_file_perms;
28
29# List HALs to get pid of vehicle HAL.
30allow carwatchdogd hwservicemanager:hwservice_manager list;
31
32# R/W /data/system/car for resource overuse configurations.
33allow carwatchdogd system_car_data_file:dir create_dir_perms;
34allow carwatchdogd system_car_data_file:{ file lnk_file } create_file_perms;
35