aboutsummaryrefslogtreecommitdiffstats
path: root/recovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'recovery.c')
-rw-r--r--recovery.c20
1 files changed, 17 insertions, 3 deletions
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();
}