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
This commit is contained in:
bigbiff
2016-03-31 13:34:49 -05:00
committed by Ethan Yonker
parent 14f8ac1cf8
commit a869fc79bc
6 changed files with 29 additions and 1 deletions
+7
View File
@@ -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;
}
+1
View File
@@ -226,5 +226,6 @@
<string name="cancel_sideload">Cancelling ADB sideload...</string>
<string name="change_fs_err">Error changing file system.</string>
<string name="theme_ver_err">Custom theme version does not match TWRP version. Using stock theme.</string>
<string name="install_reboot">Rebooting in 5 seconds</string>
</resources>
</language>
+6
View File
@@ -440,6 +440,12 @@
<data variable="tw_inject_after_zip"/>
</checkbox>
<checkbox>
<placement x="%col1_x_right%" y="%row12_y%" />
<text>{@install_reboot_chk=Reboot after installation is complete}</text>
<data variable="tw_install_reboot" />
</checkbox>
<button style="main_button_half_width">
<placement x="%col1_x_left%" y="%row15a_y%"/>
<text>{@zip_add_btn=Add more Zips}</text>
+2
View File
@@ -82,6 +82,7 @@
<string name="file">File:</string>
<string name="zip_sig_chk">Zip signature verification</string>
<string name="inject_twrp_chk">Inject TWRP after install</string>
<string name="install_reboot_chk">Reboot after installation is complete</string>
<string name="options_hdr">Options</string>
<string name="confirm_flash_hdr">Confirm Flash</string>
<string name="zip_queue">Queue:</string>
@@ -666,5 +667,6 @@
<string name="change_fs_err">Error changing file system.</string>
<string name="theme_ver_err">Custom theme version does not match TWRP version. Using stock theme.</string>
<string name="up_a_level">(Up A Level)</string>
<string name="install_reboot">Rebooting in 5 seconds</string>
</resources>
</language>
+7 -1
View File
@@ -385,9 +385,15 @@
<data variable="tw_signed_zip_verify"/>
</checkbox>
<checkbox>
<placement x="%indent%" y="%row13a_y%" />
<text>{@install_reboot_chk=Reboot after installation is complete}</text>
<data variable="tw_install_reboot" />
</checkbox>
<checkbox>
<condition var1="tw_has_injecttwrp" var2="1"/>
<placement x="%indent%" y="%row13_y%"/>
<placement x="%indent%" y="%row15_y%"/>
<text>{@inject_twrp_chk=Inject TWRP after install}</text>
<data variable="tw_inject_after_zip"/>
</checkbox>
+6
View File
@@ -525,6 +525,12 @@
<data variable="tw_inject_after_zip"/>
</checkbox>
<checkbox>
<placement x="%indent%" y="%row4_y%" />
<text>{@install_reboot_chk=Reboot after installation is complete}</text>
<data variable="tw_install_reboot" />
</checkbox>
<button>
<placement x="%col1_x_left%" y="%row11_y%"/>
<highlight color="%highlight_color%"/>