Loading bootstat/boot_reason_test.sh +5 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading Loading @@ -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} Loading bootstat/bootstat.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,8 @@ const std::map<std::string, int32_t> 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 Loading Loading @@ -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", ""}, }; Loading Loading
bootstat/boot_reason_test.sh +5 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading Loading @@ -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} Loading
bootstat/bootstat.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,8 @@ const std::map<std::string, int32_t> 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 Loading Loading @@ -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", ""}, }; Loading