summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Zongker <dougz@google.com>2012-09-24 20:42:20 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2012-09-24 20:42:20 +0200
commit4e0c8cc8dfca9f4e2738607f93c5c2d96ffc3674 (patch)
treea3cf3552a5ac7e454cf01bdcd41b576214556e57
parentam 15eaee40: (-s ours) Reconcile with jb-mr1-release - do not merge (diff)
parentam 6c8553dd: display error state on OTA failure (diff)
downloadandroid_bootable_recovery-4e0c8cc8dfca9f4e2738607f93c5c2d96ffc3674.tar
android_bootable_recovery-4e0c8cc8dfca9f4e2738607f93c5c2d96ffc3674.tar.gz
android_bootable_recovery-4e0c8cc8dfca9f4e2738607f93c5c2d96ffc3674.tar.bz2
android_bootable_recovery-4e0c8cc8dfca9f4e2738607f93c5c2d96ffc3674.tar.lz
android_bootable_recovery-4e0c8cc8dfca9f4e2738607f93c5c2d96ffc3674.tar.xz
android_bootable_recovery-4e0c8cc8dfca9f4e2738607f93c5c2d96ffc3674.tar.zst
android_bootable_recovery-4e0c8cc8dfca9f4e2738607f93c5c2d96ffc3674.zip
-rw-r--r--recovery.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 3b5813876..5c1e3cd21 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -668,12 +668,22 @@ wipe_data(int confirm, Device* device) {
}
static void
-prompt_and_wait(Device* device) {
+prompt_and_wait(Device* device, int status) {
const char* const* headers = prepend_title(device->GetMenuHeaders());
for (;;) {
finish_recovery(NULL);
- ui->SetBackground(RecoveryUI::NO_COMMAND);
+ switch (status) {
+ case INSTALL_SUCCESS:
+ case INSTALL_NONE:
+ ui->SetBackground(RecoveryUI::NO_COMMAND);
+ break;
+
+ case INSTALL_ERROR:
+ case INSTALL_CORRUPT:
+ ui->SetBackground(RecoveryUI::ERROR);
+ break;
+ }
ui->SetProgressType(RecoveryUI::EMPTY);
int chosen_item = get_menu_selection(headers, device->GetMenuItems(), 0, 0, device);
@@ -683,7 +693,6 @@ prompt_and_wait(Device* device) {
// statement below.
chosen_item = device->InvokeMenuItem(chosen_item);
- int status;
int wipe_cache;
switch (chosen_item) {
case Device::REBOOT:
@@ -920,7 +929,7 @@ main(int argc, char **argv) {
ui->SetBackground(RecoveryUI::ERROR);
}
if (status != INSTALL_SUCCESS || ui->IsTextVisible()) {
- prompt_and_wait(device);
+ prompt_and_wait(device, status);
}
// Otherwise, get ready to boot the main system...