am 6c8553dd: display error state on OTA failure
* commit '6c8553dda8b7fb45adc9f48a294c130b7e283f40': display error state on OTA failure
This commit is contained in:
+13
-4
@@ -668,12 +668,22 @@ wipe_data(int confirm, Device* device) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
prompt_and_wait(Device* device) {
|
prompt_and_wait(Device* device, int status) {
|
||||||
const char* const* headers = prepend_title(device->GetMenuHeaders());
|
const char* const* headers = prepend_title(device->GetMenuHeaders());
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
finish_recovery(NULL);
|
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);
|
ui->SetProgressType(RecoveryUI::EMPTY);
|
||||||
|
|
||||||
int chosen_item = get_menu_selection(headers, device->GetMenuItems(), 0, 0, device);
|
int chosen_item = get_menu_selection(headers, device->GetMenuItems(), 0, 0, device);
|
||||||
@@ -683,7 +693,6 @@ prompt_and_wait(Device* device) {
|
|||||||
// statement below.
|
// statement below.
|
||||||
chosen_item = device->InvokeMenuItem(chosen_item);
|
chosen_item = device->InvokeMenuItem(chosen_item);
|
||||||
|
|
||||||
int status;
|
|
||||||
int wipe_cache;
|
int wipe_cache;
|
||||||
switch (chosen_item) {
|
switch (chosen_item) {
|
||||||
case Device::REBOOT:
|
case Device::REBOOT:
|
||||||
@@ -920,7 +929,7 @@ main(int argc, char **argv) {
|
|||||||
ui->SetBackground(RecoveryUI::ERROR);
|
ui->SetBackground(RecoveryUI::ERROR);
|
||||||
}
|
}
|
||||||
if (status != INSTALL_SUCCESS || ui->IsTextVisible()) {
|
if (status != INSTALL_SUCCESS || ui->IsTextVisible()) {
|
||||||
prompt_and_wait(device);
|
prompt_and_wait(device, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, get ready to boot the main system...
|
// Otherwise, get ready to boot the main system...
|
||||||
|
|||||||
Reference in New Issue
Block a user