aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2013-07-23 11:55:16 -0700
committerKoushik Dutta <koushd@gmail.com>2013-07-23 11:55:16 -0700
commita81817cbd8d0e7e5e845b6489edae1d87ac9a1d5 (patch)
tree4eb00a07d4010968baa59d5d37e57dfebb87a8f9
parent38a43568d03d86205df9aa9b8200116f0ba24762 (diff)
downloadbootable_recovery-a81817cbd8d0e7e5e845b6489edae1d87ac9a1d5.zip
bootable_recovery-a81817cbd8d0e7e5e845b6489edae1d87ac9a1d5.tar.gz
bootable_recovery-a81817cbd8d0e7e5e845b6489edae1d87ac9a1d5.tar.bz2
more headless fixes
Change-Id: I25243f67b8bcbef41867497b442d1b7f38f638dd
-rw-r--r--Android.mk2
-rw-r--r--recovery.c20
2 files changed, 18 insertions, 4 deletions
diff --git a/Android.mk b/Android.mk
index 2e0966f..3556218 100644
--- a/Android.mk
+++ b/Android.mk
@@ -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
diff --git a/recovery.c b/recovery.c
index 7281c15..6e8555e 100644
--- a/recovery.c
+++ b/recovery.c
@@ -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();
}