static void prompt_and_wait() { char** headers = prepend_title((const char**)MENU_HEADERS); for (;;) { finish_recovery(NULL); ui_reset_progress(); allow_display_toggle = 1; int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, 0); allow_display_toggle = 0; // device-specific code may take some action here. It may // return one of the core actions handled in the switch // statement below. chosen_item = device_perform_action(chosen_item); int status; switch (chosen_item) { case ITEM_REBOOT: poweroff=0; return; case ITEM_WIPE_DATA: wipe_data(ui_text_visible()); if (!ui_text_visible()) return; break; case ITEM_WIPE_CACHE: if (confirm_selection("Confirm wipe?", "Yes - Wipe Cache")) { ui_print("\n-- Wiping cache...\n"); erase_volume("/cache"); ui_print("Cache wipe complete.\n"); if (!ui_text_visible()) return; } break; case ITEM_APPLY_SDCARD: show_install_update_menu(); break; case ITEM_NANDROID: show_nandroid_menu(); break; case ITEM_PARTITION: show_partition_menu(); break; case ITEM_ADVANCED: show_advanced_menu(); break; case ITEM_POWEROFF: poweroff = 1; return; } } }
static void prompt_and_wait() { char** headers = prepend_title((const char**)MENU_HEADERS); for (;;) { finish_recovery(NULL); ui_reset_progress(); ui_menu_level = -1; allow_display_toggle = 1; int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, 0); allow_display_toggle = 0; // device-specific code may take some action here. It may // return one of the core actions handled in the switch // statement below. chosen_item = device_perform_action(chosen_item); int status; switch (chosen_item) { case ITEM_REBOOT: show_reboot_menu(); break; case ITEM_WIPE_MENU: show_wipe_menu(); break; case ITEM_INSTALL_ZIP: show_install_update_menu(); break; case ITEM_NANDROID: show_nandroid_menu(); break; case ITEM_PARTITION: show_partition_menu(); break; case ITEM_ADVANCED: show_advanced_menu(); break; case ITEM_POWEROFF: poweroff=1; return; } } }
static void prompt_and_wait() { char** headers = prepend_title((const char**)MENU_HEADERS); for (;;) { finish_recovery(NULL); ui_reset_progress(); allow_display_toggle = 1; int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, 0); allow_display_toggle = 0; // device-specific code may take some action here. It may // return one of the core actions handled in the switch // statement below. chosen_item = device_perform_action(chosen_item); switch (chosen_item) { case ITEM_REBOOT: poweroff=0; return; case ITEM_WIPE_DATA: wipe_data(ui_text_visible()); if (!ui_text_visible()) return; break; case ITEM_WIPE_CACHE: if (confirm_selection("Confirm wipe?", "Yes - Wipe Cache")) { ui_print("\n-- Wiping cache...\n"); erase_volume("/cache"); ui_print("Cache wipe complete.\n"); if (!ui_text_visible()) return; } break; case ITEM_APPLY_SDCARD: if (confirm_selection("Confirm install?", "Yes - Install /sdcard/update.zip")) { ui_print("\n-- Install from sdcard...\n"); int status = install_package(SDCARD_PACKAGE_FILE); if (status != INSTALL_SUCCESS) { ui_set_background(BACKGROUND_ICON_ERROR); ui_print("Installation aborted.\n"); } else if (!ui_text_visible()) { return; // reboot if logs aren't visible } else { ui_print("\nInstall from sdcard complete.\n"); } } break; case ITEM_INSTALL_ZIP: show_install_update_menu(); break; case ITEM_NANDROID: show_nandroid_menu(); break; case ITEM_PARTITION: show_partition_menu(); break; case ITEM_ADVANCED: show_advanced_menu(); break; case ITEM_POWEROFF: poweroff=1; return; } } }
static void prompt_and_wait() { char** headers = prepend_title((const char**)MENU_HEADERS); for (;;) { finish_recovery(NULL); ui_reset_progress(); ui_root_menu = 1; // ui_menu_level is a legacy variable that i am keeping around to prevent build breakage. ui_menu_level = 0; // allow_display_toggle = 1; int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, 0); ui_menu_level = 1; ui_root_menu = 0; // allow_display_toggle = 0; // device-specific code may take some action here. It may // return one of the core actions handled in the switch // statement below. chosen_item = device_perform_action(chosen_item); int status; switch (chosen_item) { case ITEM_REBOOT: poweroff=0; return; case ITEM_WIPE_DATA: wipe_data(ui_text_visible()); if (!ui_text_visible()) return; break; case ITEM_WIPE_CACHE: if (confirm_selection("确认清空?", "是 - 清空CACHE分区")) { ui_print("\n-- 正在清空CACHE分区...\n"); erase_volume("/cache"); ui_print("CACHE分区已清空.\n"); if (!ui_text_visible()) return; } break; case ITEM_APPLY_ZIP: show_install_update_menu(); break; case ITEM_NANDROID: show_nandroid_menu(); break; case ITEM_PARTITION: show_partition_menu(); break; case ITEM_ADVANCED: show_advanced_menu(); break; case ITEM_POWEROFF: poweroff = 1; return; } } }
static void prompt_and_wait() { char** headers = prepend_title((const char**)MENU_HEADERS); for (;;) { finish_recovery(NULL); ui_reset_progress(); ui_root_menu = 1; // ui_menu_level is a legacy variable that i am keeping around to prevent build breakage. ui_menu_level = 0; // allow_display_toggle = 1; int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, 0); ui_menu_level = 1; ui_root_menu = 0; // allow_display_toggle = 0; // device-specific code may take some action here. It may // return one of the core actions handled in the switch // statement below. chosen_item = device_perform_action(chosen_item); int status; switch (chosen_item) { case ITEM_REBOOT: poweroff=0; return; case ITEM_WIPE_DATA: wipe_data(ui_text_visible()); if (!ui_text_visible()) return; break; case ITEM_WIPE_CACHE: if (confirm_selection("你真的要清除数据?", "我就是要删除缓存数据")) { ui_print("\n-- 正在清除 \n"); erase_volume("/cache"); ui_print("已经成功清除\n"); if (!ui_text_visible()) return; } break; case ITEM_APPLY_SDCARD: show_install_update_menu(); break; case ITEM_APPLY_SIDELOAD: apply_from_adb(); break; case ITEM_NANDROID: show_nandroid_menu(); break; case ITEM_PARTITION: show_partition_menu(); break; case ITEM_ADVANCED: show_advanced_menu(); break; case ITEM_GUOHOWFLASH: // 调用exs.c中该函数 show_guohowflash_menu(); break; case ITEM_GUOHOWWHOLEWIPE: // 调用exs.c中该函数 show_guohowwholewipe_menu(); break; case ITEM_GUOHOWHELP: // 调用exs.c中该函数 show_guohowhelp_menu(); break; case ITEM_GUOHOWABOUT: // 调用exs.c中该函数 show_guohowabout_menu(); break; case ITEM_POWEROFF: poweroff = 1; return; } } }
static void prompt_and_wait(int status) { const char** headers = prepend_title((const char**)MENU_HEADERS); switch (status) { case INSTALL_SUCCESS: case INSTALL_NONE: #ifndef PHILZ_TOUCH_RECOVERY ui_set_background(BACKGROUND_ICON_CLOCKWORK); #endif break; case INSTALL_ERROR: case INSTALL_CORRUPT: ui_set_background(BACKGROUND_ICON_ERROR); break; } for (;;) { finish_recovery(NULL); ui_root_menu = 1; ui_reset_progress(); int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, 0); ui_root_menu = 0; // device-specific code may take some action here. It may // return one of the core actions handled in the switch // statement below. (this can alter show_text state!!) chosen_item = device_perform_action(chosen_item); int ret = 0; for (;;) { switch (chosen_item) { case ITEM_REBOOT: return; case ITEM_WIPE_DATA: if (ui_IsTextVisible()) wipe_data_menu(); else wipe_data(ui_IsTextVisible()); if (!ui_IsTextVisible()) return; break; case ITEM_WIPE_CACHE: if (ui_IsTextVisible()) { wipe_data_menu(); } else { ui_print("\n-- Wiping cache...\n"); erase_volume("/cache"); ui_print("Cache wipe complete.\n"); } if (!ui_IsTextVisible()) return; break; case ITEM_APPLY_ZIP: ret = show_install_update_menu(); break; case ITEM_NANDROID: ret = show_nandroid_menu(); break; case ITEM_PARTITION: ret = show_partition_mounts_menu(); break; case ITEM_ADVANCED: show_advanced_menu(); break; case ITEM_SETTINGS: show_philz_settings_menu(); break; case ITEM_POWEROFF: show_advanced_power_menu(); break; } if (ret == REFRESH) { // this will restart the for() loop and run switch (chosen_item) action forcing to return to previous menu and refresh it ret = 0; continue; } break; } } }
static void prompt_and_wait() { const char** headers = prepend_title((const char**)MENU_HEADERS); for (;;) { finish_recovery(NULL); ui_reset_progress(); ui_root_menu = 1; // ui_menu_level is a legacy variable that i am keeping around to prevent build breakage. ui_menu_level = 0; int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, 0); ui_menu_level = 1; ui_root_menu = 0; // device-specific code may take some action here. It may // return one of the core actions handled in the switch // statement below. chosen_item = device_perform_action(chosen_item); int status; int ret = 0; for (;;) { switch (chosen_item) { case ITEM_REBOOT: return; case ITEM_WIPE_DATA: wipe_data(ui_text_visible()); if (!ui_text_visible()) return; break; case ITEM_WIPE_CACHE: if (confirm_selection("Confirm wipe?", "Yes - Wipe Cache")) { ui_print("\n-- Wiping cache...\n"); erase_volume("/cache"); ui_print("Cache wipe complete.\n"); if (!ui_text_visible()) return; } break; case ITEM_APPLY_ZIP: ret = show_install_update_menu(); break; case ITEM_NANDROID: ret = show_nandroid_menu(); break; case ITEM_PARTITION: ret = show_partition_menu(); break; case ITEM_ADVANCED: ret = show_advanced_menu(); break; } if (ret == REFRESH) { ret = 0; continue; } break; } } }