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.h b/constants.h
index 211dc96..a22b98e 100644
--- a/constants.h
+++ b/constants.h
@@ -73,6 +73,8 @@
extern const char kPrefsTotalBytesDownloaded[];
extern const char kPrefsUpdateCheckCount[];
extern const char kPrefsUpdateCheckResponseHash[];
+extern const char kPrefsUpdateCompletedBootTime[];
+extern const char kPrefsUpdateCompletedOnBootId[];
extern const char kPrefsUpdateDurationUptime[];
extern const char kPrefsUpdateFirstSeenAt[];
extern const char kPrefsUpdateOverCellularPermission[];