summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2016-04-15 22:00:26 +0200
committerandroid-build-merger <android-build-merger@google.com>2016-04-15 22:00:26 +0200
commit4846bc461ccf498f7dbf3752fedae58c1ca028b2 (patch)
tree3154dd445f3d767c4c20674eaae4e57994a6ae09 /recovery.cpp
parentMerge "Define the Bootloader Control A/B structure" am: e6af522 (diff)
parentMerge "Update the system update animation." into nyc-dev (diff)
downloadandroid_bootable_recovery-4846bc461ccf498f7dbf3752fedae58c1ca028b2.tar
android_bootable_recovery-4846bc461ccf498f7dbf3752fedae58c1ca028b2.tar.gz
android_bootable_recovery-4846bc461ccf498f7dbf3752fedae58c1ca028b2.tar.bz2
android_bootable_recovery-4846bc461ccf498f7dbf3752fedae58c1ca028b2.tar.lz
android_bootable_recovery-4846bc461ccf498f7dbf3752fedae58c1ca028b2.tar.xz
android_bootable_recovery-4846bc461ccf498f7dbf3752fedae58c1ca028b2.tar.zst
android_bootable_recovery-4846bc461ccf498f7dbf3752fedae58c1ca028b2.zip
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 921c01b6b..756e1c544 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -102,7 +102,7 @@ static const int BATTERY_OK_PERCENTAGE = 20;
static const int BATTERY_WITH_CHARGER_OK_PERCENTAGE = 15;
RecoveryUI* ui = NULL;
-char* locale = NULL;
+static const char* locale = "en_US";
char* stage = NULL;
char* reason = NULL;
bool modified_flash = false;
@@ -895,6 +895,37 @@ static void choose_recovery_file(Device* device) {
}
}
+static void run_graphics_test(Device* device) {
+ // 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->SetBackground(RecoveryUI::ERASING);
+ sleep(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);
+}
+
// How long (in seconds) we wait for the fuse-provided package file to
// appear, before timing out.
#define SDCARD_INSTALL_TIMEOUT 10
@@ -1053,6 +1084,10 @@ prompt_and_wait(Device* device, int status) {
choose_recovery_file(device);
break;
+ case Device::RUN_GRAPHICS_TEST:
+ run_graphics_test(device);
+ break;
+
case Device::MOUNT_SYSTEM:
char system_root_image[PROPERTY_VALUE_MAX];
property_get("ro.build.system_root_image", system_root_image, "");