From 653a1709350a9d66415fcef27d8f157b66a891f5 Mon Sep 17 00:00:00 2001 From: Matt Mower Date: Thu, 16 Feb 2017 10:38:52 -0600 Subject: Tweak MTP startup routine * As a precaution, (non-permanently) disable MTP if TWRP crashes. * Remove a duplicate logging of 'Starting MTP'. * Combine and improve readability of conditions before MTP starts. * Remove unnecessary Disable_MTP() call if conditions unsatisfied. Change-Id: I61ac772fc123da5b84c3061fbcf2116531bc4e2f --- partitionmanager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'partitionmanager.cpp') diff --git a/partitionmanager.cpp b/partitionmanager.cpp index ea8693f52..908730e57 100644 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -2081,8 +2081,6 @@ bool TWPartitionManager::Enable_MTP(void) { gui_err("mtp_already_enabled=MTP already enabled"); return true; } - //Launch MTP Responder - LOGINFO("Starting MTP\n"); int mtppipe[2]; @@ -2105,7 +2103,7 @@ bool TWPartitionManager::Enable_MTP(void) { TWFunc::write_file("/sys/class/android_usb/android0/idProduct", productstr); property_set("sys.usb.config", "mtp,adb"); } - /* To enable MTP debug, use the twrp command line feature to + /* To enable MTP debug, use the twrp command line feature: * twrp set tw_mtp_debug 1 */ twrpMtp *mtp = new twrpMtp(DataManager::GetIntValue("tw_mtp_debug")); -- cgit v1.2.3