bootstat: Do not allow unknown boot reasons to land in first field.
If we sniff an unknown boot reason from last kmsg, make sure it has a "reboot," prefix. Test: system/core/bootstat/boot_reason_test.sh Bug: 63736262 Change-Id: Ia1c401b8899d1f0c56bd4f5d8d2d19b7fc889a30
This commit is contained in:
parent
88d692c09e
commit
dafced93a5
|
@ -477,8 +477,10 @@ std::string BootReasonStrToReason(const std::string& boot_reason) {
|
|||
if (subReason != "") { // Will not land "reboot" as that is too blunt.
|
||||
if (isKernelRebootReason(subReason)) {
|
||||
ret = "reboot," + subReason; // User space can't talk kernel reasons.
|
||||
} else {
|
||||
} else if (isKnownRebootReason(subReason)) {
|
||||
ret = subReason;
|
||||
} else {
|
||||
ret = "reboot," + subReason; // legitimize unknown reasons
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue