Base the update complete marker on persisted data.
The update complete marker was stored in /var/run, a fixed volatile
location. The marker would signal that an update was already applied
even after an update_engine crash and subsequent restart.
This location, while quite standard on the Unix FHS, is not
available in Android. This patch achieves the same goal by storing the
boot_id in the persisted prefs directory.
Bug: 24868648
Test: Unittests. Restarted update_engine after an update, keeps saying NEED_REBOOT.
Change-Id: I4dc2cbaeaeb0fd3197fa89168deaa042cb776d61
diff --git a/constants.cc b/constants.cc
index d724564..c44e615 100644
--- a/constants.cc
+++ b/constants.cc
@@ -72,6 +72,8 @@
const char kPrefsTotalBytesDownloaded[] = "total-bytes-downloaded";
const char kPrefsUpdateCheckCount[] = "update-check-count";
const char kPrefsUpdateCheckResponseHash[] = "update-check-response-hash";
+const char kPrefsUpdateCompletedBootTime[] = "update-completed-boot-time";
+const char kPrefsUpdateCompletedOnBootId[] = "update-completed-on-boot-id";
const char kPrefsUpdateDurationUptime[] = "update-duration-uptime";
const char kPrefsUpdateFirstSeenAt[] = "update-first-seen-at";
const char kPrefsUpdateOverCellularPermission[] =