Prevent cancellation of merge polling after OTA reboot am: 542d836c5b
Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/3456206
Change-Id: I69ac15e3c2acfdc4203a00be09df269b2dc2538a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/aosp/update_attempter_android.cc b/aosp/update_attempter_android.cc
index 89c79f3..943c3e4 100644
--- a/aosp/update_attempter_android.cc
+++ b/aosp/update_attempter_android.cc
@@ -482,6 +482,18 @@
}
bool UpdateAttempterAndroid::CancelUpdate(Error* error) {
+ auto action = processor_->current_action();
+ if (action != nullptr &&
+ action->Type() == CleanupPreviousUpdateAction::StaticType()) {
+ return LogAndSetError(
+ error,
+ __LINE__,
+ __FILE__,
+ "CleanupPreviousUpdateAction is running, this action cannot be "
+ "canceled. As it often performs critical merge operations after "
+ "reboot.",
+ ErrorCode::kRollbackNotPossible);
+ }
if (!processor_->IsRunning())
return LogAndSetGenericError(
error, __LINE__, __FILE__, "No ongoing update to cancel.");