Add skeleton for zucchini patch
Also consolidates the code in partition writer to call patch functions
in one places.
Bug: 197361113
Test: TH
Change-Id: If6b5b9b6393888e67854b7130ae9a63e2fec482a
diff --git a/payload_consumer/partition_writer.cc b/payload_consumer/partition_writer.cc
index 7922eb2..75d738e 100644
--- a/payload_consumer/partition_writer.cc
+++ b/payload_consumer/partition_writer.cc
@@ -258,31 +258,16 @@
optimized, writer.get(), source_fd);
}
-bool PartitionWriter::PerformSourceBsdiffOperation(
- const InstallOperation& operation,
- ErrorCode* error,
- const void* data,
- size_t count) {
+bool PartitionWriter::PerformDiffOperation(const InstallOperation& operation,
+ ErrorCode* error,
+ const void* data,
+ size_t count) {
FileDescriptorPtr source_fd = ChooseSourceFD(operation, error);
TEST_AND_RETURN_FALSE(source_fd != nullptr);
auto writer = CreateBaseExtentWriter();
writer->Init(operation.dst_extents(), block_size_);
- return install_op_executor_.ExecuteSourceBsdiffOperation(
- operation, std::move(writer), source_fd, data, count);
-}
-
-bool PartitionWriter::PerformPuffDiffOperation(
- const InstallOperation& operation,
- ErrorCode* error,
- const void* data,
- size_t count) {
- FileDescriptorPtr source_fd = ChooseSourceFD(operation, error);
- TEST_AND_RETURN_FALSE(source_fd != nullptr);
-
- auto writer = CreateBaseExtentWriter();
- writer->Init(operation.dst_extents(), block_size_);
- return install_op_executor_.ExecutePuffDiffOperation(
+ return install_op_executor_.ExecuteDiffOperation(
operation, std::move(writer), source_fd, data, count);
}