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_android.h b/payload_consumer/verity_writer_android.h
index 7dfac0f..e95f188 100644
--- a/payload_consumer/verity_writer_android.h
+++ b/payload_consumer/verity_writer_android.h
@@ -32,11 +32,9 @@
VerityWriterAndroid() = default;
~VerityWriterAndroid() override = default;
- bool Init(const InstallPlan::Partition& partition,
- FileDescriptorPtr read_fd,
- FileDescriptorPtr write_fd) override;
bool Init(const InstallPlan::Partition& partition);
bool Update(uint64_t offset, const uint8_t* buffer, size_t size) override;
+ bool Finalize(FileDescriptorPtr read_fd, FileDescriptorPtr write_fd) override;
// Read [data_offset : data_offset + data_size) from |path| and encode FEC
// data, if |verify_mode|, then compare the encoded FEC with the one in
@@ -65,10 +63,7 @@
private:
const InstallPlan::Partition* partition_ = nullptr;
- FileDescriptorPtr read_fd_;
- FileDescriptorPtr write_fd_;
std::unique_ptr<HashTreeBuilder> hash_tree_builder_;
-
DISALLOW_COPY_AND_ASSIGN(VerityWriterAndroid);
};