# Copyright (C) 2016 The Android Open Source Project
#
# IMPORTANT: Do not create world writable files or directories.
# This is a common source of Android security bugs.
#
on post-fs-data
mkdir /data/misc/bootstat 0700 root root
# Record the time at which the user has successfully entered the pin to decrypt
# the device, /data is decrypted, and the system is entering the main boot phase.
#
# post-fs-data: /data is writable
# property:init.svc.bootanim=running: The boot animation is running
on post-fs-data && property:init.svc.bootanim=running
exec - root root -- /system/bin/bootstat -r post_decrypt_time_elapsed
# Boot animation stopped, is considered the point at which
# the user may interact with the device, so it is a good proxy for the boot
# complete signal.
on property:init.svc.bootanim=stopped
# Record boot_complete and related stats (decryption, etc).
exec - root root -- /system/bin/bootstat --record_boot_complete
on property:dev.bootcomplete=1
exec - root root -- /system/bin/bootstat -r dev_bootcomplete
# Log all boot events.
exec - root root -- /system/bin/bootstat -l
on property:boot.car_service_created=1
exec - root root -- /system/bin/bootstat -r car_service_created
on property:init.svc.zygote=running
exec - root root -- /system/bin/bootstat -r zygote_running