From abb5c4ead09e0e08e1d006fc76e7627df45c0281 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 29 Dec 2014 09:44:05 -0600 Subject: Move sleep during MTP startup to MTP thread Some devices are very slow to respond to the sysfs requests. To prevent delaying the main GUI from booting during TWRP startup, we move the sleep delay to just before we open the MTP device and into the MTP thread so that it does not hold up the main TWRP thread. Change-Id: Ic931ef317d0fb7ef4dfdef46a32f68a014ff62c0 --- partitionmanager.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'partitionmanager.cpp') diff --git a/partitionmanager.cpp b/partitionmanager.cpp index be6674b88..ea61d57d7 100644 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -1922,7 +1922,6 @@ bool TWPartitionManager::Enable_MTP(void) { TWFunc::write_file("/sys/class/android_usb/android0/idVendor", vendorstr); TWFunc::write_file("/sys/class/android_usb/android0/idProduct", productstr); property_set("sys.usb.config", "mtp,adb"); - usleep(2000); // Short sleep to prevent an occasional kernel panic on some devices std::vector::iterator iter; /* To enable MTP debug, use the twrp command line feature to * twrp set tw_mtp_debug 1 -- cgit v1.2.3