aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao2017-03-07 14:02:15 -0600
committerGerrit Code Review2017-03-07 14:02:15 -0600
commit1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8 (patch)
treec82c53436cf859c46365f2bccbc2e89ff3f1f1fe /recovery.cpp
parent73d21d1c1c9cded236b61725e49caf8819ba8bb0 (diff)
parentdb7e8980802b16aab20871c1a87350558df7754d (diff)
downloadplatform-bootable-recovery-1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8.tar.gz
platform-bootable-recovery-1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8.tar.xz
platform-bootable-recovery-1a575f8d5ff81238bd6b3f366bb3d1d40a0ccdd8.zip
Merge "recovery: Add SetStage() into 'Run graphics test'."
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 223ca94d..61d3bf4f 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -969,35 +969,47 @@ static void choose_recovery_file(Device* device) {
969 } 969 }
970} 970}
971 971
972static void run_graphics_test(Device* device) { 972static void run_graphics_test() {
973 // Switch to graphics screen. 973 // Switch to graphics screen.
974 ui->ShowText(false); 974 ui->ShowText(false);
975 975
976 ui->SetProgressType(RecoveryUI::INDETERMINATE); 976 ui->SetProgressType(RecoveryUI::INDETERMINATE);
977 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE); 977 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
978 sleep(1); 978 sleep(1);
979
980 ui->SetBackground(RecoveryUI::ERROR);
981 sleep(1);
982
983 ui->SetBackground(RecoveryUI::NO_COMMAND);
984 sleep(1);
985 979
986 ui->SetBackground(RecoveryUI::ERASING); 980 ui->SetBackground(RecoveryUI::ERROR);
987 sleep(1); 981 sleep(1);
988 982
989 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE); 983 ui->SetBackground(RecoveryUI::NO_COMMAND);
984 sleep(1);
990 985
991 ui->SetProgressType(RecoveryUI::DETERMINATE); 986 ui->SetBackground(RecoveryUI::ERASING);
992 ui->ShowProgress(1.0, 10.0); 987 sleep(1);
993 float fraction = 0.0; 988
994 for (size_t i = 0; i < 100; ++i) { 989 // Calling SetBackground() after SetStage() to trigger a redraw.
995 fraction += .01; 990 ui->SetStage(1, 3);
996 ui->SetProgress(fraction); 991 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
997 usleep(100000); 992 sleep(1);
998 } 993 ui->SetStage(2, 3);
994 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
995 sleep(1);
996 ui->SetStage(3, 3);
997 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
998 sleep(1);
999
1000 ui->SetStage(-1, -1);
1001 ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
1002
1003 ui->SetProgressType(RecoveryUI::DETERMINATE);
1004 ui->ShowProgress(1.0, 10.0);
1005 float fraction = 0.0;
1006 for (size_t i = 0; i < 100; ++i) {
1007 fraction += .01;
1008 ui->SetProgress(fraction);
1009 usleep(100000);
1010 }
999 1011
1000 ui->ShowText(true); 1012 ui->ShowText(true);
1001} 1013}
1002 1014
1003// How long (in seconds) we wait for the fuse-provided package file to 1015// How long (in seconds) we wait for the fuse-provided package file to
@@ -1165,7 +1177,7 @@ prompt_and_wait(Device* device, int status) {
1165 break; 1177 break;
1166 1178
1167 case Device::RUN_GRAPHICS_TEST: 1179 case Device::RUN_GRAPHICS_TEST:
1168 run_graphics_test(device); 1180 run_graphics_test();
1169 break; 1181 break;
1170 1182
1171 case Device::MOUNT_SYSTEM: 1183 case Device::MOUNT_SYSTEM: