1type hal_dumpstate_impl, domain;
2hal_server_domain(hal_dumpstate_impl, hal_dumpstate)
3
4type hal_dumpstate_impl_exec, exec_type, vendor_file_type, file_type;
5init_daemon_domain(hal_dumpstate_impl)
6
7# Execute dump scripts from vendor partition
8allow hal_dumpstate_impl vendor_shell_exec:file rx_file_perms;
9allow hal_dumpstate_impl vendor_toolbox_exec:file rx_file_perms;
10
11# Allow to read pixel-trace trace file
12allow hal_dumpstate_impl debugfs_tracing_instances:dir search;
13allow hal_dumpstate_impl debugfs_tracing_instances:file r_file_perms;
14
15userdebug_or_eng(`
16  allow hal_dumpstate_impl sysfs_usb_device:dir r_dir_perms;
17  allow hal_dumpstate_impl sysfs_usb_device:file r_file_perms;
18  allow hal_dumpstate_impl ssr_log_file:dir search;
19  allow hal_dumpstate_impl ssr_log_file:file r_file_perms;
20  allow hal_dumpstate_impl tcpdump_vendor_data_file:dir create_dir_perms;
21  allow hal_dumpstate_impl tcpdump_vendor_data_file:file create_file_perms;
22
23  set_prop(hal_dumpstate_impl, vendor_tcpdump_log_prop)
24')
25allow hal_dumpstate_impl modem_dump_file:dir create_dir_perms;
26allow hal_dumpstate_impl modem_dump_file:file create_file_perms;
27
28set_prop(hal_dumpstate_impl, vendor_modem_diag_prop)
29
30allow hal_dumpstate_impl radio_vendor_data_file:dir r_dir_perms;
31allow hal_dumpstate_impl radio_vendor_data_file:file r_file_perms;
32allow hal_dumpstate_impl netmgr_data_file:dir r_dir_perms;
33allow hal_dumpstate_impl netmgr_data_file:file r_file_perms;
34get_prop(hal_dumpstate_impl, vendor_tcpdump_log_prop)
35
36# modem stat
37domain_auto_trans(hal_dumpstate_impl, modem_svc_exec, modem_svc)
38allow hal_dumpstate_impl modem_stat_data_file:file r_file_perms;
39
40allow hal_dumpstate_impl uio_device:chr_file rw_file_perms;
41r_dir_file(hal_dumpstate_impl, sysfs_uio)
42r_dir_file(hal_dumpstate_impl, sysfs_rmtfs)
43r_dir_file(hal_dumpstate_impl, sysfs_msm_subsys)
44r_dir_file(hal_dumpstate_impl, sysfs_soc)
45r_dir_file(hal_dumpstate_impl, sysfs_thermal)
46r_dir_file(hal_dumpstate_impl, sysfs_easel)
47
48allow hal_dumpstate_impl sysfs_esim:file r_file_perms;
49allow hal_dumpstate_impl sysfs_rpm:file r_file_perms;
50allow hal_dumpstate_impl sysfs_system_sleep_stats:file r_file_perms;
51
52allow hal_dumpstate_impl debugfs_ion:dir r_dir_perms;
53allow hal_dumpstate_impl debugfs_ion:file r_file_perms;
54allow hal_dumpstate_impl debugfs_wlan:dir r_dir_perms;
55allow hal_dumpstate_impl debugfs_wlan:file r_file_perms;
56allow hal_dumpstate_impl debugfs_icnss:dir r_dir_perms;
57allow hal_dumpstate_impl debugfs_icnss:file r_file_perms;
58allow hal_dumpstate_impl debugfs_ipc:dir r_dir_perms;
59allow hal_dumpstate_impl debugfs_ipc:file r_file_perms;
60allow hal_dumpstate_impl debugfs_f2fs:dir r_dir_perms;
61allow hal_dumpstate_impl debugfs_f2fs:file r_file_perms;
62allow hal_dumpstate_impl debugfs_tzdbg:dir search;
63allow hal_dumpstate_impl debugfs_tzdbg:file r_file_perms;
64allow hal_dumpstate_impl debugfs_ufs:dir r_dir_perms;
65allow hal_dumpstate_impl debugfs_ufs:file r_file_perms;
66allow hal_dumpstate_impl proc_stat:file r_file_perms;
67allow hal_dumpstate_impl proc_f2fs:dir r_dir_perms;
68allow hal_dumpstate_impl proc_f2fs:file r_file_perms;
69
70# Access to files for dumping
71allow hal_dumpstate_impl  sysfs:dir r_dir_perms;
72# usb logs
73allow hal_dumpstate_impl debugfs_usb:file r_file_perms;
74
75#Access display debug data
76allow hal_dumpstate_impl display_vendor_data_file:dir r_dir_perms;
77allow hal_dumpstate_impl display_vendor_data_file:file r_file_perms;
78
79# Access to touch firmware info
80allow hal_dumpstate_impl sysfs_touch:dir r_dir_perms;
81allow hal_dumpstate_impl sysfs_touch:file rw_file_perms;
82
83# Access to touch proc node
84allow hal_dumpstate_impl proc_touch:file rw_file_perms;
85
86# Access to WLC firmware info
87allow hal_dumpstate_impl sysfs_wlc:dir r_dir_perms;
88allow hal_dumpstate_impl sysfs_wlc:file r_file_perms;
89
90# Access to UFS info
91allow hal_dumpstate_impl sysfs_scsi_devices_0000:dir r_dir_perms;
92allow hal_dumpstate_impl sysfs_scsi_devices_0000:file r_file_perms;
93
94# Access to MPSS RFS info
95allow hal_dumpstate_impl mpss_rfs_data_file:dir r_dir_perms;
96allow hal_dumpstate_impl mpss_rfs_data_file:file r_file_perms;
97
98# For collecting bugreports.
99allow hal_dumpstate_impl debugfs_system_ion_heap:file r_file_perms;
100allow hal_dumpstate_impl shell_data_file:file getattr;
101allow hal_dumpstate_impl sysfs_system_sleep_stats:file r_file_perms;
102# For '/vendor/bin/sh -c getprop | grep vendor.sys.modem.diag'
103allow hal_dumpstate_impl vendor_file:file execute_no_trans;
104userdebug_or_eng(`allow hal_dumpstate_impl debugfs_dma_bufinfo:file r_file_perms;')
105dontaudit hal_dumpstate_impl debugfs_dma_bufinfo:file r_file_perms;
106
107# Query and dump power supply nodes
108allow hal_dumpstate_impl sysfs_batteryinfo:dir search;
109allow hal_dumpstate_impl sysfs_batteryinfo:file r_file_perms;
110
111# Dump QCOM FG content
112allow hal_dumpstate_impl debugfs_fg_sram:dir search;
113allow hal_dumpstate_impl debugfs_fg_sram:file rw_file_perms;
114
115# Dump Maxim FG content
116allow hal_dumpstate_impl debugfs_maxfg:dir search;
117allow hal_dumpstate_impl debugfs_maxfg:file r_file_perms;
118allow hal_dumpstate_impl tmpfs:dir search;
119allow hal_dumpstate_impl maxfg_device:chr_file r_file_perms;
120
121# Dump PMIC votables
122allow hal_dumpstate_impl debugfs_pmic_votable:dir r_dir_perms;
123allow hal_dumpstate_impl debugfs_pmic_votable:file r_file_perms;
124
125userdebug_or_eng(`
126  # Citadel communication must be via citadeld
127  vndbinder_use(hal_dumpstate_impl)
128  binder_call(hal_dumpstate_impl, citadeld)
129  allow hal_dumpstate_impl citadeld_service:service_manager find;
130')
131
132# Vibrator
133r_dir_file(hal_dumpstate_impl, sysfs_leds)
134
135dontaudit hal_dumpstate_impl binder_device:chr_file rw_file_perms;
136dontaudit hal_dumpstate_impl vndbinder_device:chr_file rw_file_perms;
137
138# Access to vendor logging property
139set_prop(hal_dumpstate_impl, vendor_logging_prop)
140