Blacklist versions as part of Rollback along with unittests.
This CL adds version blacklisting as part of AU Rollback. A few additional
things:
1) Since this pref must persist across rollback I have introduced a
powerwash_safe_prefs as part of system_state that will persist across
powerwashes.
2) Fixed bug where we needed to read the device policy (which is read during an
update_check before Rollback would work).
3) Some refactoring to move pref constants to constants.
4) Passing keepimg into our powerwash command so we don't wipe the old
partitions.
BUG=chromium:252589 chromium:254217
TEST=Unittests + test on device + using rollback with and without powerwash
checking preserve state.
Change-Id: I991fad944594944425fd9941e10b30a919f2b83b
Reviewed-on: https://gerrit.chromium.org/gerrit/59518
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
diff --git a/payload_state_interface.h b/payload_state_interface.h
index a7129c9..54c7c9f 100644
--- a/payload_state_interface.h
+++ b/payload_state_interface.h
@@ -58,6 +58,9 @@
// depending on the type of the error that happened.
virtual void UpdateFailed(ErrorCode error) = 0;
+ // This method should be called every time we initiate a Rollback.
+ virtual void Rollback() = 0;
+
// Returns true if we should backoff the current download attempt.
// False otherwise.
virtual bool ShouldBackoffDownload() = 0;
@@ -112,6 +115,10 @@
// Called at update_engine startup to do various house-keeping.
virtual void UpdateEngineStarted() = 0;
+
+ // Returns the version from before a rollback if our last update was a
+ // rollback.
+ virtual std::string GetRollbackVersion() = 0;
};
} // namespace chromeos_update_engine