summaryrefslogtreecommitdiffstats
path: root/install.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2009-06-25 02:39:16 +0200
committerThe Android Open Source Project <initial-contribution@android.com>2009-06-25 02:39:16 +0200
commit4275c3cfc828ac2df143d353a4e27e8dda20b4a9 (patch)
treef36a4716573ef9d73f445a73c06bfa7b74054606 /install.c
parentadd device extension mechanism to updater (diff)
parentimprove updater progress bar (diff)
downloadandroid_bootable_recovery-4275c3cfc828ac2df143d353a4e27e8dda20b4a9.tar
android_bootable_recovery-4275c3cfc828ac2df143d353a4e27e8dda20b4a9.tar.gz
android_bootable_recovery-4275c3cfc828ac2df143d353a4e27e8dda20b4a9.tar.bz2
android_bootable_recovery-4275c3cfc828ac2df143d353a4e27e8dda20b4a9.tar.lz
android_bootable_recovery-4275c3cfc828ac2df143d353a4e27e8dda20b4a9.tar.xz
android_bootable_recovery-4275c3cfc828ac2df143d353a4e27e8dda20b4a9.tar.zst
android_bootable_recovery-4275c3cfc828ac2df143d353a4e27e8dda20b4a9.zip
Diffstat (limited to 'install.c')
-rw-r--r--install.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/install.c b/install.c
index cbb35805c..ab19478cf 100644
--- a/install.c
+++ b/install.c
@@ -210,7 +210,15 @@ try_update_binary(const char *path, ZipArchive *zip) {
// progress bar. The program can write single-line commands:
//
// progress <frac> <secs>
- // fill up <frac> of the progress bar over <secs> seconds.
+ // fill up the next <frac> part of of the progress bar
+ // over <secs> seconds. If <secs> is zero, use
+ // set_progress commands to manually control the
+ // progress of this segment of the bar
+ //
+ // set_progress <frac>
+ // <frac> should be between 0.0 and 1.0; sets the
+ // progress bar within the segment defined by the most
+ // recent progress command.
//
// firmware <"hboot"|"radio"> <filename>
// arrange to install the contents of <filename> in the
@@ -261,6 +269,10 @@ try_update_binary(const char *path, ZipArchive *zip) {
ui_show_progress(fraction * (1-VERIFICATION_PROGRESS_FRACTION),
seconds);
+ } else if (strcmp(command, "set_progress") == 0) {
+ char* fraction_s = strtok(NULL, " \n");
+ float fraction = strtof(fraction_s, NULL);
+ ui_set_progress(fraction);
} else if (strcmp(command, "firmware") == 0) {
char* type = strtok(NULL, " \n");
char* filename = strtok(NULL, " \n");