Merge "bootstat: Hook up bootstat to record the boot complete signal and log boot events in the LOCAL_INIT_RC file, bootstat.rc."
am: dac84b5a1a

* commit 'dac84b5a1adf75fd81a7456faac7bf3953e8276a':
  bootstat: Hook up bootstat to record the boot complete signal and log boot events in the LOCAL_INIT_RC file, bootstat.rc.
diff --git a/bootstat/Android.mk b/bootstat/Android.mk
index 223450d..bbb903d 100644
--- a/bootstat/Android.mk
+++ b/bootstat/Android.mk
@@ -110,6 +110,7 @@
 LOCAL_C_INCLUDES := $(bootstat_c_includes)
 LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
 LOCAL_STATIC_LIBRARIES := libbootstat
+LOCAL_INIT_RC := bootstat.rc
 LOCAL_SRC_FILES := $(bootstat_src_files)
 # Clang is required because of C++14
 LOCAL_CLANG := true
diff --git a/bootstat/bootstat.rc b/bootstat/bootstat.rc
new file mode 100644
index 0000000..2c37dd2
--- /dev/null
+++ b/bootstat/bootstat.rc
@@ -0,0 +1,14 @@
+# This file is the LOCAL_INIT_RC file for the bootstat command.
+
+on post-fs-data
+    mkdir /data/misc/bootstat 0700 root root
+
+# This marker, boot animation stopped, is considered the point at which the
+# 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 timing event.
+    exec - root root -- /system/bin/bootstat -r boot_complete
+
+    # Log all boot events.
+    exec - root root -- /system/bin/bootstat -l