Write cow merge sequence at beginning of update

As part of the design for go/vabc-xor , update_engine needs to
tell libsnapshot what the merge sequence is. To do that, we represent
the merge sequence with increasing block numbers(of new partitions),
and hand the giant array to libsnapshot.

Test: th
Bug: 177104308

Change-Id: Idd74ed54a8bf74443c40d8c2025657fd7c35561d
diff --git a/payload_consumer/vabc_partition_writer.h b/payload_consumer/vabc_partition_writer.h
index e8601a9..c73bd4d 100644
--- a/payload_consumer/vabc_partition_writer.h
+++ b/payload_consumer/vabc_partition_writer.h
@@ -34,8 +34,7 @@
   VABCPartitionWriter(const PartitionUpdate& partition_update,
                       const InstallPlan::Partition& install_part,
                       DynamicPartitionControlInterface* dynamic_control,
-                      size_t block_size,
-                      bool is_interactive);
+                      size_t block_size);
   [[nodiscard]] bool Init(const InstallPlan* install_plan,
                           bool source_may_exist,
                           size_t next_op_index) override;
@@ -72,11 +71,14 @@
 
   [[nodiscard]] bool FinishedInstallOps() override;
   int Close() override;
+  // Send merge sequence data to cow writer
+  static bool WriteMergeSequence(
+      const ::google::protobuf::RepeatedPtrField<CowMergeOperation>& merge_ops,
+      android::snapshot::ICowWriter* cow_writer);
 
  private:
   std::unique_ptr<android::snapshot::ISnapshotWriter> cow_writer_;
 
-  bool OpenCurrentECCPartition();
   [[nodiscard]] std::unique_ptr<ExtentWriter> CreateBaseExtentWriter();
 
   const PartitionUpdate& partition_update_;
@@ -85,7 +87,6 @@
   // Path to source partition
   std::string source_path_;
 
-  const bool interactive_;
   const size_t block_size_;
   InstallOperationExecutor executor_;
   VerifiedSourceFd verified_source_fd_;