Avoid VAB merge when running a DSU
Bug: 147071959
Test: ota_e2etest.py
Merged-In: I9c8dcb4a2648d814672a966ce951516c1682d5f2
Change-Id: I9c8dcb4a2648d814672a966ce951516c1682d5f2
diff --git a/cleanup_previous_update_action.cc b/cleanup_previous_update_action.cc
index 26cc6be..e43730d 100644
--- a/cleanup_previous_update_action.cc
+++ b/cleanup_previous_update_action.cc
@@ -30,6 +30,7 @@
#include "update_engine/common/utils.h"
#include "update_engine/payload_consumer/delta_performer.h"
+using android::base::GetBoolProperty;
using android::snapshot::SnapshotManager;
using android::snapshot::SnapshotMergeStats;
using android::snapshot::UpdateState;
@@ -335,6 +336,12 @@
void CleanupPreviousUpdateAction::InitiateMergeAndWait() {
TEST_AND_RETURN(running_);
LOG(INFO) << "Attempting to initiate merge.";
+ // suspend the VAB merge when running a DSU
+ if (GetBoolProperty("ro.gsid.image_running", false)) {
+ LOG(WARNING) << "Suspend the VAB merge when running a DSU.";
+ processor_->ActionComplete(this, ErrorCode::kError);
+ return;
+ }
if (snapshot_->InitiateMerge()) {
WaitForMergeOrSchedule();