summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-03-07 21:02:15 +0100
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-03-07 21:02:15 +0100
commit1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8 (patch)
treec82c53436cf859c46365f2bccbc2e89ff3f1f1fe /recovery.cpp
parentMerge "recovery: Minor clean up to choose_recovery_file()." (diff)
parentrecovery: Add SetStage() into 'Run graphics test'. (diff)
downloadandroid_bootable_recovery-1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8.tar
android_bootable_recovery-1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8.tar.gz
android_bootable_recovery-1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8.tar.bz2
android_bootable_recovery-1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8.tar.lz
android_bootable_recovery-1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8.tar.xz
android_bootable_recovery-1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8.tar.zst
android_bootable_recovery-1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8.zip
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp62
1 files changed, 37 insertions, 25 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 223ca94d0..61d3bf4f7 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -969,35 +969,47 @@ static void choose_recovery_file(Device* device) {
}
}
-static void run_graphics_test(Device* device) {
- // Switch to graphics screen.
- ui->ShowText(false);
+static void run_graphics_test() {
+ // Switch to graphics screen.
+ ui->ShowText(false);
- ui->SetProgressType(RecoveryUI::INDETERMINATE);
- ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
- sleep(1);
-
- ui->SetBackground(RecoveryUI::ERROR);
- sleep(1);
-
- ui->SetBackground(RecoveryUI::NO_COMMAND);
- sleep(1);
+ ui->SetProgressType(RecoveryUI::INDETERMINATE);
+ ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
+ sleep(1);
- ui->SetBackground(RecoveryUI::ERASING);
- sleep(1);
+ ui->SetBackground(RecoveryUI::ERROR);
+ sleep(1);
- ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
+ ui->SetBackground(RecoveryUI::NO_COMMAND);
+ sleep(1);
- ui->SetProgressType(RecoveryUI::DETERMINATE);
- ui->ShowProgress(1.0, 10.0);
- float fraction = 0.0;
- for (size_t i = 0; i < 100; ++i) {
- fraction += .01;
- ui->SetProgress(fraction);
- usleep(100000);
- }
+ ui->SetBackground(RecoveryUI::ERASING);
+ sleep(1);
+
+ // Calling SetBackground() after SetStage() to trigger a redraw.
+ ui->SetStage(1, 3);
+ ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
+ sleep(1);
+ ui->SetStage(2, 3);
+ ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
+ sleep(1);
+ ui->SetStage(3, 3);
+ ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
+ sleep(1);
+
+ ui->SetStage(-1, -1);
+ ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
+
+ ui->SetProgressType(RecoveryUI::DETERMINATE);
+ ui->ShowProgress(1.0, 10.0);
+ float fraction = 0.0;
+ for (size_t i = 0; i < 100; ++i) {
+ fraction += .01;
+ ui->SetProgress(fraction);
+ usleep(100000);
+ }
- ui->ShowText(true);
+ ui->ShowText(true);
}
// How long (in seconds) we wait for the fuse-provided package file to
@@ -1165,7 +1177,7 @@ prompt_and_wait(Device* device, int status) {
break;
case Device::RUN_GRAPHICS_TEST:
- run_graphics_test(device);
+ run_graphics_test();
break;
case Device::MOUNT_SYSTEM: