From a869fc79bca0f65e5d0d25b0ecd2e86abc127926 Mon Sep 17 00:00:00 2001 From: bigbiff Date: Tue, 1 Mar 2016 19:40:36 -0500 Subject: TWRP Install Reboot Option This is a simple patch to allow users to reboot after installation of zip queue. Current timeout is 5 seconds before reboot. Change-Id: I1a18cbf7025086e35031ab7241b330babebb8343 --- gui/action.cpp | 7 +++++++ gui/devices/common/res/languages/en.xml | 1 + gui/theme/common/landscape.xml | 6 ++++++ gui/theme/common/languages/en.xml | 2 ++ gui/theme/common/portrait.xml | 8 +++++++- gui/theme/common/watch.xml | 6 ++++++ 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/gui/action.cpp b/gui/action.cpp index e08111850..aac2c313f 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1026,7 +1026,14 @@ int GUIAction::flash(std::string arg) reinject_after_flash(); PartitionManager.Update_System_Details(); + if (DataManager::GetIntValue("tw_install_reboot") > 0 && ret_val == 0) { + gui_msg("install_reboot=Rebooting in 5 seconds"); + usleep(5000000); + TWFunc::tw_reboot(rb_system); + usleep(5000000); // another sleep while we wait for the reboot to occur + } operation_end(ret_val); + // This needs to be after the operation_end call so we change pages before we change variables that we display on the screen DataManager::SetValue(TW_ZIP_QUEUE_COUNT, zip_queue_index); return 0; } diff --git a/gui/devices/common/res/languages/en.xml b/gui/devices/common/res/languages/en.xml index f7a7b77e5..8ce476254 100644 --- a/gui/devices/common/res/languages/en.xml +++ b/gui/devices/common/res/languages/en.xml @@ -226,5 +226,6 @@ Cancelling ADB sideload... Error changing file system. Custom theme version does not match TWRP version. Using stock theme. + Rebooting in 5 seconds diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml index ba96e4186..525a2c1da 100644 --- a/gui/theme/common/landscape.xml +++ b/gui/theme/common/landscape.xml @@ -440,6 +440,12 @@ + + + {@install_reboot_chk=Reboot after installation is complete} + + +