From c7eee6fef0263ed4eb5aa0d934a0a8c972d41b30 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Tue, 2 Sep 2014 18:59:01 -0400 Subject: add mtp responder to TWRP. Big thanks to Dees_Troy for helping with the implementation. Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0 --- gui/action.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'gui/action.cpp') diff --git a/gui/action.cpp b/gui/action.cpp index c471533ef..7e432226e 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1305,7 +1305,6 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) } 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 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */) 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 { -- cgit v1.2.3