Estimate COW image size during OTA generation
Estimate COW image size and put the estimation in OTA metadata. Then VAB
could use this to allocate disk space and prompt the user if more space
required.
Test: create an OTA package
Change-Id: Iaedafcf39af2d1a4d9cae9cd1a642a3cd3a4815c
diff --git a/payload_consumer/vabc_partition_writer.h b/payload_consumer/vabc_partition_writer.h
index 3fc97ce..ddade70 100644
--- a/payload_consumer/vabc_partition_writer.h
+++ b/payload_consumer/vabc_partition_writer.h
@@ -18,9 +18,11 @@
#define UPDATE_ENGINE_VABC_PARTITION_WRITER_H_
#include <memory>
+#include <vector>
#include <libsnapshot/snapshot_writer.h>
+#include "update_engine/common/cow_operation_convert.h"
#include "update_engine/payload_consumer/install_plan.h"
#include "update_engine/payload_consumer/partition_writer.h"
@@ -44,6 +46,11 @@
[[nodiscard]] bool Flush() override;
void CheckpointUpdateProgress(size_t next_op_index) override;
+ static bool WriteAllCowOps(size_t block_size,
+ const std::vector<CowOperation>& converted,
+ android::snapshot::ICowWriter* cow_writer,
+ FileDescriptorPtr source_fd);
+
private:
std::unique_ptr<android::snapshot::ISnapshotWriter> cow_writer_;
};