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
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index ea8693f..908730e 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -2081,8 +2081,6 @@
gui_err("mtp_already_enabled=MTP already enabled");
return true;
}
- //Launch MTP Responder
- LOGINFO("Starting MTP\n");
int mtppipe[2];
@@ -2105,7 +2103,7 @@
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"));