diff options
-rw-r--r-- | Android.mk | 2 | ||||
-rw-r--r-- | recovery.c | 20 |
2 files changed, 18 insertions, 4 deletions
@@ -38,7 +38,7 @@ RECOVERY_NAME := CWM-based Recovery endif endif -RECOVERY_VERSION := $(RECOVERY_NAME) v6.0.3.3 +RECOVERY_VERSION := $(RECOVERY_NAME) v6.0.3.4 LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)" RECOVERY_API_VERSION := 2 @@ -680,6 +680,15 @@ wipe_data(int confirm) { ui_print("Data wipe complete.\n"); } +static void headless_wait() { + ui_show_text(0); + char** headers = prepend_title((const char**)MENU_HEADERS); + for (;;) { + finish_recovery(NULL); + get_menu_selection(headers, MENU_ITEMS, 0, 0); + } +} + int ui_menu_level = 1; int ui_root_menu = 0; static void @@ -962,8 +971,10 @@ main(int argc, char **argv) { signature_check_enabled = 0; script_assert_enabled = 0; is_user_initiated_recovery = 1; - ui_set_show_text(1); - ui_set_background(BACKGROUND_ICON_CLOCKWORK); + if (!headless) { + ui_set_show_text(1); + ui_set_background(BACKGROUND_ICON_CLOCKWORK); + } if (extendedcommand_file_exists()) { LOGI("Running extendedcommand...\n"); @@ -982,11 +993,14 @@ main(int argc, char **argv) { setup_adbd(); + if (headless) { + headless_wait(); + } if (status != INSTALL_SUCCESS && !is_user_initiated_recovery) { ui_set_show_text(1); ui_set_background(BACKGROUND_ICON_ERROR); } - if (status != INSTALL_SUCCESS || ui_text_visible()) { + else if (status != INSTALL_SUCCESS || ui_text_visible()) { prompt_and_wait(); } |