diff options
author | Amin Hassani <ahassani@chromium.org> | 2019-08-29 09:20:12 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-09-05 17:21:07 +0000 |
commit | 9be122effd4022e14cc158191e11ca230a605544 (patch) | |
tree | 901e425a6b1c1f7f289683dbd39bd8994266212f /update_status_utils.cc | |
parent | 0199b7544974a4d61ddb52a0591d8f3e2d9757b9 (diff) |
update_engine: Pass is_enterprise_rollback in the StatusResult
Currently Chrome uses some sort of version comparison to define whether
an update is a rollback or not. But that is not very robust. The correct
way is the return this value in the StatusResult. We already have this
value as a placeholder in the update_engine.proto. So this is good to
go.
BUG=chromium:864672
TEST=FEATUERS=test emerge-reef update_engine
Change-Id: I8bd3af0d94abd656dc00a9e67550ea6c6913de91
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1775116
Tested-by: Amin Hassani <ahassani@chromium.org>
Commit-Queue: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
Diffstat (limited to 'update_status_utils.cc')
-rw-r--r-- | update_status_utils.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/update_status_utils.cc b/update_status_utils.cc index 07583148..639dc8be 100644 --- a/update_status_utils.cc +++ b/update_status_utils.cc @@ -33,6 +33,7 @@ namespace { // exactly these matches. const char kCurrentOp[] = "CURRENT_OP"; const char kIsInstall[] = "IS_INSTALL"; +const char kIsEnterpriseRollback[] = "IS_ENTERPRISE_ROLLBACK"; const char kLastCheckedTime[] = "LAST_CHECKED_TIME"; const char kNewSize[] = "NEW_SIZE"; const char kNewVersion[] = "NEW_VERSION"; @@ -88,6 +89,8 @@ string UpdateEngineStatusToString(const UpdateEngineStatus& status) { #endif key_value_store.SetString(kCurrentOp, UpdateStatusToString(status.status)); key_value_store.SetString(kNewVersion, status.new_version); + key_value_store.SetBoolean(kIsEnterpriseRollback, + status.is_enterprise_rollback); key_value_store.SetBoolean(kIsInstall, status.is_install); return key_value_store.SaveToString(); |