Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bc17c6f authored by Ethan Yonker's avatar Ethan Yonker Committed by Dees Troy
Browse files

Fix occasional MTP kernel panic

Add a short sleep between setting up the sysfs entries for MTP and
actually sending MTP data to the MTP device. In some cases a
kernel panic was happening because we were sending data too soon.

Change-Id: Ie5e05690846fc84f161c91829de448bc049f87e2
parent 738be7a3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1904,6 +1904,7 @@ 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<TWPartition*>::iterator iter;
	/* To enable MTP debug, use the twrp command line feature to
	 * twrp set tw_mtp_debug 1