ResetStatus if update_engine boot in different slot but same build
Old behavior:
When update_engine starts up after device take OTA and reboot, if
device booted into a different build(check build fingerprint),
ResetStatus().
When we apply a self-ota, device will boot into the same build, so
ResetStatus() is never called. If we apply the same OTA at this point,
this OTA will be treated as a "resume", and will fail to install because
we never call libsnapshot's API to allocate snapshot for new update.
Changed to ResetStatus() if boot slot changed, or build fingerprint
changed.
Bug: 185019674
Test: apply self-full OTA, reboot, repeat 2 times.
Change-Id: Idcc29dc1c02f3b9b2c84ed1978abedb651a3875a
diff --git a/common/constants.cc b/common/constants.cc
index a9cf238..0677e66 100644
--- a/common/constants.cc
+++ b/common/constants.cc
@@ -112,6 +112,7 @@
const char kPrefsWallClockStagingWaitPeriod[] =
"wall-clock-staging-wait-period";
const char kPrefsManifestBytes[] = "manifest-bytes";
+const char kPrefsPreviousSlot[] = "previous-slot";
// These four fields are generated by scripts/brillo_update_payload.
const char kPayloadPropertyFileSize[] = "FILE_SIZE";