fix adb sideload

- "Cancel" button handling requires another thread
- simplify handling of child pid
- merge duplicated code for reinjecting TWRP after installation
- fix error that showed on host PC after sideload finished
- fix problem where adbd sometimes does not stop correctly

Change-Id: I536877f024b606756c6a3289c6ddfdba423a60d6
This commit is contained in:
that
2015-01-03 01:59:36 +01:00
committed by Ethan Yonker
parent d83c9ea371
commit cc8ddca9bd
6 changed files with 117 additions and 116 deletions
+2 -1
View File
@@ -356,7 +356,8 @@ int OpenRecoveryScript::run_script_file(void) {
gui_print("Starting ADB sideload feature...\n");
DataManager::SetValue("tw_has_cancel", 1);
DataManager::SetValue("tw_cancel_action", "adbsideloadcancel");
ret_val = apply_from_adb(Sideload_File.c_str());
pid_t child_pid;
ret_val = apply_from_adb(Sideload_File.c_str(), &child_pid);
DataManager::SetValue("tw_has_cancel", 0);
if (ret_val != 0)
ret_val = 1; // failure