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/filesystem_verifier_action.cc b/payload_consumer/filesystem_verifier_action.cc
index e88337b..dfbe513 100644
--- a/payload_consumer/filesystem_verifier_action.cc
+++ b/payload_consumer/filesystem_verifier_action.cc
@@ -80,7 +80,9 @@
namespace {
const off_t kReadFileBufferSize = 128 * 1024;
-constexpr float kVerityProgressPercent = 0.6;
+constexpr float kVerityProgressPercent = 0.3;
+constexpr float kEncodeFECPercent = 0.3;
+
} // namespace
void FilesystemVerifierAction::PerformAction() {
@@ -239,6 +241,8 @@
LOG(ERROR) << "Failed to write verity data";
Cleanup(ErrorCode::kVerityCalculationError);
}
+ UpdatePartitionProgress(kVerityProgressPercent +
+ verity_writer_->GetProgress() * kEncodeFECPercent);
CHECK(pending_task_id_.PostTask(
FROM_HERE,
base::BindOnce(&FilesystemVerifierAction::WriteVerityData,
@@ -333,8 +337,9 @@
// verity writes and partition hashing. Otherwise, the entire progress bar is
// dedicated to partition hashing for smooth progress.
if (ShouldWriteVerity()) {
- UpdatePartitionProgress(progress * (1 - kVerityProgressPercent) +
- kVerityProgressPercent);
+ UpdatePartitionProgress(
+ progress * (1 - (kVerityProgressPercent + kEncodeFECPercent)) +
+ kVerityProgressPercent + kEncodeFECPercent);
} else {
UpdatePartitionProgress(progress);
}