From 699e342b3d77c4e2b7e856621e1ce1150859582f Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 22 May 2019 09:46:02 -0700 Subject: [PATCH] Report non-empty system boot reason when bootloader reason is empty Bug: 133321647 Test: build Change-Id: Icd3ea4b69ef2ad040926e2b0e121a8f5f1c1b658 --- bootstat/bootstat.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp index 558e6c4b2..7b6052404 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp @@ -1086,17 +1086,8 @@ void RecordAbsoluteBootTime(BootEventRecordStore* boot_event_store, void LogBootInfoToStatsd(std::chrono::milliseconds end_time, std::chrono::milliseconds total_duration, int32_t bootloader_duration_ms, double time_since_last_boot_sec) { - const auto reason = android::base::GetProperty(bootloader_reboot_reason_property, ""); - - if (reason.empty()) { - android::util::stats_write(android::util::BOOT_SEQUENCE_REPORTED, "", "", - end_time.count(), total_duration.count(), - (int64_t)bootloader_duration_ms, - (int64_t)time_since_last_boot_sec * 1000); - return; - } - - const auto system_reason = android::base::GetProperty(system_reboot_reason_property, ""); + auto reason = android::base::GetProperty(bootloader_reboot_reason_property, ""); + auto system_reason = android::base::GetProperty(system_reboot_reason_property, ""); android::util::stats_write(android::util::BOOT_SEQUENCE_REPORTED, reason.c_str(), system_reason.c_str(), end_time.count(), total_duration.count(), (int64_t)bootloader_duration_ms,