Call CowWriter::Finalize() before attempting to get size of COW
When actually applying an OTA, we call Finalize() on each partition.
Emulate this behavior on host side simulation tools.
Test: th
Change-Id: I68be3a450d68d446a42e0bf40c004375871675e0
diff --git a/payload_generator/cow_size_estimator.cc b/payload_generator/cow_size_estimator.cc
index fc66e67..01e9965 100644
--- a/payload_generator/cow_size_estimator.cc
+++ b/payload_generator/cow_size_estimator.cc
@@ -116,6 +116,7 @@
cow_writer.Initialize(android::base::borrowed_fd{-1});
CHECK(CowDryRun(
target_fd, operations, merge_operations, block_size, &cow_writer));
+ CHECK(cow_writer.Finalize());
return cow_writer.GetCowSize();
}