summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2020-01-21 19:23:14 -0800
committerandroid-build-merger <android-build-merger@google.com>2020-01-21 19:23:14 -0800
commit42ff364d65d97ef529cb392bfedcfaa39f58f2eb (patch)
tree21f47da3500b475d522d9a8d958dd626a668edf3
parent45cad119d1aa92f9475498e0048c5aa6d1bc5b01 (diff)
parente5a8f23df27bbcf5c6bd3b764819d765a632b18e (diff)
update_engine_client_android implement --merge
am: e5a8f23df2 Change-Id: I640f91c17ffc235cd3369220f1f97f04b299b418
-rw-r--r--update_engine_client_android.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/update_engine_client_android.cc b/update_engine_client_android.cc
index 7766f793..7d9bc3de 100644
--- a/update_engine_client_android.cc
+++ b/update_engine_client_android.cc
@@ -144,7 +144,10 @@ int UpdateEngineClientAndroid::OnInit() {
false,
"Follow status update changes until a final state is reached. "
"Exit status is 0 if the update succeeded, and 1 otherwise.");
-
+ DEFINE_bool(merge,
+ false,
+ "Wait for previous update to merge. "
+ "Only available after rebooting to new slot.");
// Boilerplate init commands.
base::CommandLine::Init(argc_, argv_);
brillo::FlagHelper::Init(argc_, argv_, "Android Update Engine Client");
@@ -222,6 +225,16 @@ int UpdateEngineClientAndroid::OnInit() {
return ExitWhenIdle(status);
}
+ if (FLAGS_merge) {
+ int32_t ret = 0;
+ Status status = service_->cleanupSuccessfulUpdate(&ret);
+ if (status.isOk()) {
+ LOG(INFO) << "CleanupSuccessfulUpdate exits with "
+ << utils::ErrorCodeToString(static_cast<ErrorCode>(ret));
+ }
+ return ExitWhenIdle(status);
+ }
+
if (FLAGS_follow) {
// Register a callback object with the service.
callback_ = new UECallback(this);