1typeattribute incident coredomain;
2
3type incident_exec, system_file_type, exec_type, file_type;
4
5# switch to incident domain for incident command
6domain_auto_trans(shell, incident_exec, incident)
7domain_auto_trans(dumpstate, incident_exec, incident)
8
9# allow incident access to stdout from its parent shell.
10allow incident shell:fd use;
11
12# allow incident to communicate with dumpstate, and write incident report to
13# /data/data/com.android.shell/files/bugreports/tmp_incident_report
14allow incident dumpstate:fd use;
15allow incident dumpstate:unix_stream_socket { read write };
16allow incident shell_data_file:file write;
17
18# allow incident be able to output data for CTS to fetch.
19allow incident devpts:chr_file { read write };
20
21# allow incident to communicate use, read and write over the adb
22# connection.
23allow incident adbd:fd use;
24allow incident adbd:unix_stream_socket { read write };
25
26# allow adbd to reap incident
27allow incident adbd:process { sigchld };
28
29# Allow the incident command to talk to the incidentd over the binder, and get
30# back the incident report data from a ParcelFileDescriptor.
31binder_use(incident)
32allow incident incident_service:service_manager find;
33binder_call(incident, incidentd)
34allow incident incidentd:fifo_file write;
35
36# only allow incident being called by shell or dumpstate
37neverallow { domain -su -shell -incident -dumpstate} incident_exec:file { execute execute_no_trans };
38