add mtp responder to TWRP.
Big thanks to Dees_Troy for helping with the implementation. Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0
This commit is contained in:
+26
-1
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user