xref: /aosp_15_r20/system/sepolicy/prebuilts/api/34.0/private/bootstat.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Workertypeattribute bootstat coredomain;
2*e4a36f41SAndroid Build Coastguard Worker
3*e4a36f41SAndroid Build Coastguard Workerinit_daemon_domain(bootstat)
4*e4a36f41SAndroid Build Coastguard Worker
5*e4a36f41SAndroid Build Coastguard Worker# Collect metrics on boot time created by init
6*e4a36f41SAndroid Build Coastguard Workerget_prop(bootstat, boottime_prop)
7*e4a36f41SAndroid Build Coastguard Worker
8*e4a36f41SAndroid Build Coastguard Worker# Read/Write [persist.]sys.boot.reason and ro.boot.bootreason (write if empty)
9*e4a36f41SAndroid Build Coastguard Workerset_prop(bootstat, bootloader_boot_reason_prop)
10*e4a36f41SAndroid Build Coastguard Workerset_prop(bootstat, system_boot_reason_prop)
11*e4a36f41SAndroid Build Coastguard Workerset_prop(bootstat, last_boot_reason_prop)
12*e4a36f41SAndroid Build Coastguard Worker
13*e4a36f41SAndroid Build Coastguard Workerneverallow {
14*e4a36f41SAndroid Build Coastguard Worker  domain
15*e4a36f41SAndroid Build Coastguard Worker  -bootanim
16*e4a36f41SAndroid Build Coastguard Worker  -bootstat
17*e4a36f41SAndroid Build Coastguard Worker  -dumpstate
18*e4a36f41SAndroid Build Coastguard Worker  userdebug_or_eng(`-incidentd')
19*e4a36f41SAndroid Build Coastguard Worker  -init
20*e4a36f41SAndroid Build Coastguard Worker  -recovery
21*e4a36f41SAndroid Build Coastguard Worker  -shell
22*e4a36f41SAndroid Build Coastguard Worker  -system_server
23*e4a36f41SAndroid Build Coastguard Worker} { bootloader_boot_reason_prop last_boot_reason_prop }:file r_file_perms;
24*e4a36f41SAndroid Build Coastguard Worker# ... and refine, as these components should not set the last boot reason
25*e4a36f41SAndroid Build Coastguard Workerneverallow { bootanim recovery } last_boot_reason_prop:file r_file_perms;
26*e4a36f41SAndroid Build Coastguard Worker
27*e4a36f41SAndroid Build Coastguard Workerneverallow {
28*e4a36f41SAndroid Build Coastguard Worker  domain
29*e4a36f41SAndroid Build Coastguard Worker  -bootstat
30*e4a36f41SAndroid Build Coastguard Worker  -init
31*e4a36f41SAndroid Build Coastguard Worker  -system_server
32*e4a36f41SAndroid Build Coastguard Worker} { bootloader_boot_reason_prop last_boot_reason_prop }:property_service set;
33*e4a36f41SAndroid Build Coastguard Worker# ... and refine ... for a ro propertly no less ... keep this _tight_
34*e4a36f41SAndroid Build Coastguard Workerneverallow system_server bootloader_boot_reason_prop:property_service set;
35