Collect metrics for android update attempt
Report the update attempt/result metrics when an upate finishes;
and abnormally terminated updates/time to reboot when the device
reboots.
Bug: 30989466
Test: update_engine_unittest pass
Change-Id: Iea16b4e8003ae3dab5e9b7c65cf4b38d2219d203
diff --git a/payload_state_unittest.cc b/payload_state_unittest.cc
index a69c5ac..c47e389 100644
--- a/payload_state_unittest.cc
+++ b/payload_state_unittest.cc
@@ -1095,8 +1095,8 @@
FakePrefs fake_prefs;
// Set the clock to a well-known time (t = 30 seconds).
- fake_clock.SetWallclockTime(Time::FromInternalValue(
- 30 * Time::kMicrosecondsPerSecond));
+ fake_clock.SetMonotonicTime(
+ Time::FromInternalValue(30 * Time::kMicrosecondsPerSecond));
fake_system_state.set_clock(&fake_clock);
fake_system_state.set_prefs(&fake_prefs);
@@ -1114,8 +1114,8 @@
// (t = 500 seconds). We do this by using a new PayloadState object
// and checking that it emits the right UMA metric with the right
// value.
- fake_clock.SetWallclockTime(Time::FromInternalValue(
- 500 * Time::kMicrosecondsPerSecond));
+ fake_clock.SetMonotonicTime(
+ Time::FromInternalValue(500 * Time::kMicrosecondsPerSecond));
PayloadState payload_state2;
EXPECT_TRUE(payload_state2.Initialize(&fake_system_state));