Delete DynamicPartitionControl::CleanupSuccessfulUpdate

It is replaced with GetCleanupPreviousUpdateAction now.

Test: builds
Bug: 147696014
Change-Id: I8cb281bf811052d1dfea6c14c8685a90915cafa8
Merged-In: I8cb281bf811052d1dfea6c14c8685a90915cafa8
diff --git a/common/dynamic_partition_control_interface.h b/common/dynamic_partition_control_interface.h
index 8de9d76..952e8d4 100644
--- a/common/dynamic_partition_control_interface.h
+++ b/common/dynamic_partition_control_interface.h
@@ -84,15 +84,6 @@
   // this function to indicate writes to new partitions are done.
   virtual bool FinishUpdate() = 0;
 
-  // Deprecated. Use GetCleanupPreviousUpdateAction instead.
-  // Before applying the next update, call this function to clean up previous
-  // update files. This function blocks until delta files are merged into
-  // current OS partitions and finished cleaning up.
-  // - If successful, return kSuccess.
-  // - If any error, but caller should retry after reboot, return kError.
-  // - If any irrecoverable failures, return kDeviceCorrupted.
-  virtual ErrorCode CleanupSuccessfulUpdate() = 0;
-
   // Get an action to clean up previous update.
   // Return NoOpAction on non-Virtual A/B devices.
   // Before applying the next update, run this action to clean up previous
diff --git a/common/dynamic_partition_control_stub.cc b/common/dynamic_partition_control_stub.cc
index 70d6768..3d31e20 100644
--- a/common/dynamic_partition_control_stub.cc
+++ b/common/dynamic_partition_control_stub.cc
@@ -53,10 +53,6 @@
   return true;
 }
 
-ErrorCode DynamicPartitionControlStub::CleanupSuccessfulUpdate() {
-  return ErrorCode::kError;
-}
-
 std::unique_ptr<AbstractAction>
 DynamicPartitionControlStub::GetCleanupPreviousUpdateAction(
     BootControlInterface* boot_control,
diff --git a/common/dynamic_partition_control_stub.h b/common/dynamic_partition_control_stub.h
index 92e9922..9be988b 100644
--- a/common/dynamic_partition_control_stub.h
+++ b/common/dynamic_partition_control_stub.h
@@ -40,7 +40,6 @@
                                   uint64_t* required_size) override;
 
   bool FinishUpdate() override;
-  ErrorCode CleanupSuccessfulUpdate() override;
   std::unique_ptr<AbstractAction> GetCleanupPreviousUpdateAction(
       BootControlInterface* boot_control,
       PrefsInterface* prefs,
diff --git a/dynamic_partition_control_android.cc b/dynamic_partition_control_android.cc
index 84c2f78..1993661 100644
--- a/dynamic_partition_control_android.cc
+++ b/dynamic_partition_control_android.cc
@@ -736,21 +736,6 @@
   mapped_devices_ = fake;
 }
 
-ErrorCode DynamicPartitionControlAndroid::CleanupSuccessfulUpdate() {
-  // Already reboot into new boot. Clean up.
-  if (!GetVirtualAbFeatureFlag().IsEnabled()) {
-    return ErrorCode::kSuccess;
-  }
-  auto ret = snapshot_->WaitForMerge();
-  if (ret.is_ok()) {
-    return ErrorCode::kSuccess;
-  }
-  if (ret.error_code() == Return::ErrorCode::NEEDS_REBOOT) {
-    return ErrorCode::kError;
-  }
-  return ErrorCode::kDeviceCorrupted;
-}
-
 bool DynamicPartitionControlAndroid::IsRecovery() {
   return kIsRecovery;
 }
diff --git a/dynamic_partition_control_android.h b/dynamic_partition_control_android.h
index aff0296..c842efc 100644
--- a/dynamic_partition_control_android.h
+++ b/dynamic_partition_control_android.h
@@ -45,7 +45,6 @@
                                   bool update,
                                   uint64_t* required_size) override;
   bool FinishUpdate() override;
-  ErrorCode CleanupSuccessfulUpdate() override;
   std::unique_ptr<AbstractAction> GetCleanupPreviousUpdateAction(
       BootControlInterface* boot_control,
       PrefsInterface* prefs,