bootstat: system_boot_reason does not handle reboot_<reason> case
Heuristic would translate reboot_<reason> to reboot._<reason>. Add checking/squashing for leading comma (,) _or_ underscore (_). Test: compile Bug: 63736262 Change-Id: I7ef4930ec8c064a8151183ac08d292931a8584c8
This commit is contained in:
parent
9e6c11da18
commit
0af71a5327
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue