Verity writes propogate progress report
Test: tested on cuttlefish device with inc_ota from build 9263663 9419942. Ensured progress grows linearly from 0 - 0.6. Half time spent in read step, half in Verity Writes.
Change-Id: Iffa16571e828909cd6ac58f262736c0b6ca7b066
diff --git a/payload_consumer/verity_writer_android.cc b/payload_consumer/verity_writer_android.cc
index 479231d..31d2875 100644
--- a/payload_consumer/verity_writer_android.cc
+++ b/payload_consumer/verity_writer_android.cc
@@ -150,6 +150,10 @@
return current_step_ == EncodeFECStep::kComplete;
}
+double IncrementalEncodeFEC::ReportProgress() const {
+ return static_cast<double>(current_round_) / num_rounds_;
+}
+
namespace verity_writer {
std::unique_ptr<VerityWriterInterface> CreateVerityWriter() {
return std::make_unique<VerityWriterAndroid>();
@@ -312,6 +316,11 @@
}
return false;
}
+
+double VerityWriterAndroid::GetProgress() {
+ return encodeFEC_.ReportProgress();
+}
+
bool VerityWriterAndroid::EncodeFEC(FileDescriptor* read_fd,
FileDescriptor* write_fd,
uint64_t data_offset,