From 0af71a53278677648315b7413f725526f7606852 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Thu, 5 Oct 2017 13:58:04 -0700 Subject: [PATCH] bootstat: system_boot_reason does not handle reboot_ case Heuristic would translate reboot_ to reboot._. Add checking/squashing for leading comma (,) _or_ underscore (_). Test: compile Bug: 63736262 Change-Id: I7ef4930ec8c064a8151183ac08d292931a8584c8 --- bootstat/bootstat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp index 17986b9e3..d26cf856f 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp @@ -570,7 +570,7 @@ std::string BootReasonStrToReason(const std::string& boot_reason) { ret = "reboot"; if (android::base::StartsWith(reason, "reboot")) { reason = reason.substr(strlen("reboot")); - while (reason[0] == ',') { + while ((reason[0] == ',') || (reason[0] == '_')) { reason = reason.substr(1); } }