From 0bc4ad479ae82d4c7815f4190682935360a9ad4a Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Tue, 30 May 2017 15:03:15 -0700 Subject: [PATCH] bootstat: Log factory_reset_boot_complete separately from ota_*. Bug: 37164359 Test: none Change-Id: I7ed68e299846050fdffa58db8d2bd35fe4599dbb --- bootstat/bootstat.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp index d4e215efe..a4c216033 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp @@ -201,8 +201,10 @@ std::string CalculateBootCompletePrefix() { BootEventRecordStore boot_event_store; BootEventRecordStore::BootEventRecord record; - if (!boot_event_store.GetBootEvent(kBuildDateKey, &record) || - build_date != record.second) { + if (!boot_event_store.GetBootEvent(kBuildDateKey, &record)) { + boot_complete_prefix = "factory_reset_" + boot_complete_prefix; + boot_event_store.AddBootEventWithValue(kBuildDateKey, build_date); + } else if (build_date != record.second) { boot_complete_prefix = "ota_" + boot_complete_prefix; boot_event_store.AddBootEventWithValue(kBuildDateKey, build_date); } @@ -241,7 +243,7 @@ const BootloaderTimingMap GetBootLoaderTimings() { for (const auto& stageTiming : stages) { // |stageTiming| is of the form 'stage:time'. auto stageTimingValues = android::base::Split(stageTiming, ":"); - DCHECK_EQ(2, stageTimingValues.size()); + DCHECK_EQ(2U, stageTimingValues.size()); std::string stageName = stageTimingValues[0]; int32_t time_ms;