summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSurge Raval <Surge1223@gmail.com>2019-10-08 00:53:55 +0200
committerAli B <abittin@gmail.com>2021-02-10 14:59:37 +0300
commit6b457fc17704a88056c21211fa803b4d335ebab2 (patch)
treea11e64a5a1a08ae3f00c782801e0a4168a205eeb
parentd791445cba3ad73d757d19ee7c6bc9614226270a (diff)
Add sideload UI and split reporting into thirds
Change-Id: I671c3d0bdce5c99c577af0fe1891415ab8aea729
-rw-r--r--sideload_main.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/sideload_main.cc b/sideload_main.cc
index 27967cda..a32bb0c7 100644
--- a/sideload_main.cc
+++ b/sideload_main.cc
@@ -70,16 +70,31 @@ class SideloadDaemonState : public DaemonStateInterface,
UpdateStatus status = update_engine_status.status;
double progress = update_engine_status.progress;
if (status_ != status && (status == UpdateStatus::DOWNLOADING ||
- status == UpdateStatus::FINALIZING)) {
+ status == UpdateStatus::VERIFYING || status == UpdateStatus::FINALIZING)) {
// Split the progress bar in two parts for the two stages DOWNLOADING and
// FINALIZING.
ReportStatus(base::StringPrintf(
- "ui_print Step %d/2", status == UpdateStatus::DOWNLOADING ? 1 : 2));
- ReportStatus(base::StringPrintf("progress 0.5 0"));
+ "ui_print Step %d/3", status == UpdateStatus::DOWNLOADING ? 1 : 2));
+ ReportStatus(base::StringPrintf("progress 0.3 0"));
}
+
if (status_ != status || fabs(progress - progress_) > 0.005) {
ReportStatus(base::StringPrintf("set_progress %.lf", progress));
}
+
+ if (status_ != status && (status == UpdateStatus::DOWNLOADING ||
+ status == UpdateStatus::VERIFYING || status == UpdateStatus::FINALIZING)) {
+ // Split the progress bar in two parts for the two stages DOWNLOADING and
+ // FINALIZING.
+ ReportStatus(base::StringPrintf(
+ "ui_print Step %d/3", status == UpdateStatus::VERIFYING ? 2 : 3));
+ ReportStatus(base::StringPrintf("progress 0.6 0"));
+ }
+
+ if (status_ != status || fabs(progress - progress_) > 0.005) {
+ ReportStatus(base::StringPrintf("set_progress %.lf", progress));
+ }
+
progress_ = progress;
status_ = status;
}