From 01b6d0c9befc7fb41c989a48d3b0a403aafd6317 Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Tue, 22 Jan 2013 01:41:09 +0000 Subject: Convert AOSP commands to ORS for encrypted devices Change-Id: I6a76a51cd9efd7db67d7abeeb26f9bdd0eebf5a9 --- gui/action.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gui') diff --git a/gui/action.cpp b/gui/action.cpp index 997cf558e..9c3ee5916 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1014,6 +1014,18 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) DataManager::SetValue(TW_IS_ENCRYPTED, 0); DataManager::ReadSettingsFile(); + // Check for the SCRIPT_FILE_TMP first as these are AOSP recovery commands + // that we converted to ORS commands during boot in recovery.cpp. + // Run those first. + if (TWFunc::Path_Exists(SCRIPT_FILE_TMP)) { + ui_print("Processing AOSP recovery commands...\n"); + if (OpenRecoveryScript::run_script_file() == 0) { + usleep(2000000); // Sleep for 2 seconds before rebooting + TWFunc::tw_reboot(rb_system); + load_theme = 0; + } + } + // Check for the ORS file in /cache and attempt to run those commands. if (OpenRecoveryScript::check_for_script_file()) { ui_print("Processing OpenRecoveryScript file...\n"); if (OpenRecoveryScript::run_script_file() == 0) { -- cgit v1.2.3