add mtp responder to TWRP.
Big thanks to Dees_Troy for helping with the implementation.
Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0
diff --git a/gui/action.cpp b/gui/action.cpp
index c471533..7e43222 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -1305,7 +1305,6 @@
} else {
ret = 1; // failure
}
- PartitionManager.Update_System_Details();
if (DataManager::GetIntValue(TW_HAS_INJECTTWRP) == 1 && DataManager::GetIntValue(TW_INJECT_AFTER_ZIP) == 1) {
operation_start("ReinjectTWRP");
gui_print("Injecting TWRP into boot image...\n");
@@ -1469,6 +1468,32 @@
operation_end(op_status, simulate);
return 0;
}
+ if (function == "startmtp")
+ {
+ int op_status = 0;
+
+ operation_start("Start MTP");
+ if (PartitionManager.Enable_MTP())
+ op_status = 0; // success
+ else
+ op_status = 1; // fail
+
+ operation_end(op_status, simulate);
+ return 0;
+ }
+ if (function == "stopmtp")
+ {
+ int op_status = 0;
+
+ operation_start("Stop MTP");
+ if (PartitionManager.Disable_MTP())
+ op_status = 0; // success
+ else
+ op_status = 1; // fail
+
+ operation_end(op_status, simulate);
+ return 0;
+ }
}
else
{