From 5216bef553f680b450aa6d6c8a26d24a2d57a29e Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Wed, 17 Dec 2014 11:40:21 -0600 Subject: Toggle MTP during ADB sideload Windows does not do very well if you try to sideload while MTP is enabled due to drivers. This will toggle MTP off and back on if MTP is currently enabled before and after a sideload operation. Change-Id: I022dbedecc97565b50b6ae1fda8922b822f63440 --- gui/action.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gui') diff --git a/gui/action.cpp b/gui/action.cpp index d72b33194..27fd7a5d7 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1268,6 +1268,7 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) int wipe_dalvik = 0; gui_print("Starting ADB sideload feature...\n"); + bool mtp_was_enabled = TWFunc::Toggle_MTP(false); DataManager::GetValue("tw_wipe_dalvik", wipe_dalvik); ret = apply_from_adb("/"); DataManager::SetValue("tw_has_cancel", 0); // Remove cancel button from gui now that the zip install is going to start @@ -1289,6 +1290,7 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) set_usb_driver(false); maybe_restart_adbd(); } + TWFunc::Toggle_MTP(mtp_was_enabled); if (strcmp(file_prop, "error") != 0) { struct stat st; stat("/sideload/exit", &st); -- cgit v1.2.3