diff options
author | Dees_Troy <dees_troy@yahoo.com> | 2013-02-21 15:26:57 +0100 |
---|---|---|
committer | Dees_Troy <dees_troy@teamw.in> | 2013-02-21 19:23:43 +0100 |
commit | 6ef6635ad3d5e8f6440e9ac2b67f1db8589e77b5 (patch) | |
tree | f6c1bc2e0210477d8c1fb91061f9defa135b4359 /gui/action.cpp | |
parent | add military time option (diff) | |
download | android_bootable_recovery-6ef6635ad3d5e8f6440e9ac2b67f1db8589e77b5.tar android_bootable_recovery-6ef6635ad3d5e8f6440e9ac2b67f1db8589e77b5.tar.gz android_bootable_recovery-6ef6635ad3d5e8f6440e9ac2b67f1db8589e77b5.tar.bz2 android_bootable_recovery-6ef6635ad3d5e8f6440e9ac2b67f1db8589e77b5.tar.lz android_bootable_recovery-6ef6635ad3d5e8f6440e9ac2b67f1db8589e77b5.tar.xz android_bootable_recovery-6ef6635ad3d5e8f6440e9ac2b67f1db8589e77b5.tar.zst android_bootable_recovery-6ef6635ad3d5e8f6440e9ac2b67f1db8589e77b5.zip |
Diffstat (limited to 'gui/action.cpp')
-rw-r--r-- | gui/action.cpp | 58 |
1 files changed, 39 insertions, 19 deletions
diff --git a/gui/action.cpp b/gui/action.cpp index f1dac1c9b..ca968d088 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -341,26 +341,16 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) DataManager::GetValue(TW_SIMULATE_ACTIONS, simulate); - if (function == "reboot") - { - //curtainClose(); this sometimes causes a crash - - sync(); - - if (arg == "recovery") - TWFunc::tw_reboot(rb_recovery); - else if (arg == "poweroff") - TWFunc::tw_reboot(rb_poweroff); - else if (arg == "bootloader") - TWFunc::tw_reboot(rb_bootloader); - else if (arg == "download") - TWFunc::tw_reboot(rb_download); - else - TWFunc::tw_reboot(rb_system); + if (function == "reboot") + { + //curtainClose(); this sometimes causes a crash - // This should never occur - return -1; - } + sync(); + DataManager::SetValue("tw_gui_done", 1); + DataManager::SetValue("tw_reboot_arg", arg); + + return 0; + } if (function == "home") { PageManager::SelectPackage("TWRP"); @@ -1143,6 +1133,36 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) } } } + if (function == "installsu") + { + int op_status = 0; + + operation_start("Install SuperSU"); + if (simulate) { + simulate_progress_bar(); + } else { + if (!TWFunc::Install_SuperSU()) + op_status = 1; + } + + operation_end(op_status, simulate); + return 0; + } + if (function == "fixsu") + { + int op_status = 0; + + operation_start("Fixing Superuser Permissions"); + if (simulate) { + simulate_progress_bar(); + } else { + if (!TWFunc::Fix_su_Perms()) + op_status = 1; + } + + operation_end(op_status, simulate); + return 0; + } } else { |