Refactor verity reads/writes to a separate fucntion
Test: th & serve an OTA with veity enabled, vabc disabled
Change-Id: Ib1d5549ac615504a47c96a12b046975cfff01886
diff --git a/payload_consumer/verity_writer_interface.h b/payload_consumer/verity_writer_interface.h
index db7988e..37ed605 100644
--- a/payload_consumer/verity_writer_interface.h
+++ b/payload_consumer/verity_writer_interface.h
@@ -31,9 +31,6 @@
public:
virtual ~VerityWriterInterface() = default;
- virtual bool Init(const InstallPlan::Partition& partition,
- FileDescriptorPtr read_fd,
- FileDescriptorPtr write_fd) = 0;
virtual bool Init(const InstallPlan::Partition& partition) = 0;
// Update partition data at [offset : offset + size) stored in |buffer|.
// Data not in |hash_tree_data_extent| or |fec_data_extent| is ignored.
@@ -41,6 +38,10 @@
// blocks has passed.
virtual bool Update(uint64_t offset, const uint8_t* buffer, size_t size) = 0;
+ // Write hash tree && FEC data to underlying fd, if they are present
+ virtual bool Finalize(FileDescriptorPtr read_fd,
+ FileDescriptorPtr write_fd) = 0;
+
protected:
VerityWriterInterface() = default;