summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-01-25 16:01:29 +0100
committerDees_Troy <dees_troy@teamw.in>2013-01-25 16:10:48 +0100
commit6ed34b7f61c144a09d457d608290eea81aae702d (patch)
treef1d6a3d3b680fb69e7e9520e4e92e564f594e119 /gui/action.cpp
parentConvert AOSP commands to ORS for encrypted devices (diff)
downloadandroid_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar.gz
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar.bz2
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar.lz
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar.xz
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.tar.zst
android_bootable_recovery-6ed34b7f61c144a09d457d608290eea81aae702d.zip
Diffstat (limited to 'gui/action.cpp')
-rw-r--r--gui/action.cpp53
1 files changed, 30 insertions, 23 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index 9c3ee5916..19a8b69a0 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -1013,27 +1013,6 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
int load_theme = 1;
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) {
- usleep(2000000); // Sleep for 2 seconds before rebooting
- TWFunc::tw_reboot(rb_system);
- load_theme = 0;
- }
- }
if (load_theme) {
int has_datamedia;
@@ -1083,7 +1062,6 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
string result, Sideload_File;
if (!PartitionManager.Mount_Current_Storage(true)) {
- DataManager::SetValue("tw_page_done", "1"); // For OpenRecoveryScript support
operation_end(1, simulate);
return 0;
}
@@ -1114,7 +1092,6 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
}
}
}
- DataManager::SetValue("tw_page_done", "1"); // For OpenRecoveryScript support
operation_end(ret, simulate);
return 0;
}
@@ -1130,6 +1107,36 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
DataManager::SetValue("tw_page_done", "1"); // For OpenRecoveryScript support
return 0;
}
+ if (function == "openrecoveryscript") {
+ operation_start("OpenRecoveryScript");
+ if (simulate) {
+ simulate_progress_bar();
+ } else {
+ // 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.
+ int reboot = 0;
+ if (TWFunc::Path_Exists(SCRIPT_FILE_TMP)) {
+ ui_print("Processing AOSP recovery commands...\n");
+ if (OpenRecoveryScript::run_script_file() == 0) {
+ reboot = 1;
+ }
+ }
+ // 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) {
+ reboot = 1;
+ }
+ }
+ if (reboot) {
+ usleep(2000000); // Sleep for 2 seconds before rebooting
+ TWFunc::tw_reboot(rb_system);
+ } else {
+ DataManager::SetValue("tw_page_done", 1);
+ }
+ }
+ }
}
else
{