diff --git a/bootstat/boot_reason_test.sh b/bootstat/boot_reason_test.sh index 209e81b4c..af65135df 100755 --- a/bootstat/boot_reason_test.sh +++ b/bootstat/boot_reason_test.sh @@ -194,10 +194,12 @@ wait_for_screen() { sed -n 's/[[]sys[.]\(boot_completed\|logbootcomplete\)[]]: [[]\([01]\)[]]$/\1=\2/p'` if [ "${vals}" = "`echo boot_completed=1 ; echo logbootcomplete=1`" ] then + sleep 1 break fi if [ "${vals}" = "`echo logbootcomplete=1 ; echo boot_completed=1`" ] then + sleep 1 break fi fi @@ -287,6 +289,7 @@ bootstat: Service started: /system/bin/bootstat -l bootstat: Battery level at shutdown 100% bootstat: Battery level at startup 100% init : Parsing file /system/etc/init/bootstat.rc... +init : Parsing file /system/etc/init/bootstat-debug.rc... init : processing action (persist.test.boot.reason=*) from (/system/etc/init/bootstat-debug.rc: init : Command 'setprop ro.boot.bootreason \${persist.test.boot.reason}' action=persist.test.boot.reason=* (/system/etc/init/bootstat-debug.rc: init : processing action (post-fs-data) from (/system/etc/init/bootstat.rc @@ -566,6 +569,8 @@ blind_reboot_test() { esac adb reboot ${TEST} wait_for_screen + bootloader_reason=`validate_property ro.boot.bootreason` + EXPECT_PROPERTY ro.boot.bootreason ${bootloader_reason} EXPECT_PROPERTY sys.boot.reason ${reason} EXPECT_PROPERTY persist.sys.boot.reason ${reason} report_bootstat_logs ${reason} diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp index 22701339d..c1d799e51 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp @@ -223,6 +223,8 @@ const std::map kBootReasonMap = { {"2sec_reboot", 83}, {"reboot,by_key", 84}, {"reboot,longkey", 85}, + {"reboot,2sec", 86}, + {"shutdown,thermal,battery", 87}, }; // Converts a string value representing the reason the system booted to an @@ -406,6 +408,7 @@ std::string BootReasonStrToReason(const std::string& boot_reason) { {"shutdown,thermal", "thermal"}, {"warm,s3_wakeup", "s3_wakeup"}, {"hard,hw_reset", "hw_reset"}, + {"reboot,2sec", "2sec_reboot"}, {"bootloader", ""}, };