Allow toggle of MTP debug

Via command line in TWRP:
twrp set tw_mtp_debug 1

This will enable debugging for MTP. You will need to disable and
re-enable MTP in order to see the debug logging.

Change-Id: Ia7bb0c584e10a4322b65ecf80a67ed7ee836b38e
This commit is contained in:
Ethan Yonker
2014-09-03 14:19:43 -05:00
parent 20fd25c231
commit 6d154c4fe2
5 changed files with 23 additions and 12 deletions
+4 -1
View File
@@ -2171,7 +2171,10 @@ bool TWPartitionManager::Enable_MTP(void) {
TWFunc::write_file("/sys/class/android_usb/android0/idProduct", productstr);
property_set("sys.usb.config", "mtp,adb");
std::vector<TWPartition*>::iterator iter;
twrpMtp *mtp = new twrpMtp();
/* To enable MTP debug, use the twrp command line feature to
* twrp set tw_mtp_debug 1
*/
twrpMtp *mtp = new twrpMtp(DataManager::GetIntValue("tw_mtp_debug"));
for (iter = Partitions.begin(); iter != Partitions.end(); iter++) {
if ((*iter)->Is_Storage && (*iter)->Is_Present && (*iter)->Mount(false)) {
printf("twrp mtpid: %d\n", (*iter)->mtpid);