MTP FFS updates:

This update splits old MTP code and new MTP code from Google
into two trees, legacy and ffs. Depending on the SDK level,
the build system will select the correct version. The reason
for separating the versions out are due to older android trees
not supporting the updated MTP code from Google.

Most MTP code is from Google, with additions needed from
implementing the Java functions in C++ for TWRP and FFS.

We assume if you are in android-9.0 or above, your kernel
has support for FFS over MTP. Verify that your init.rc
is mounting the MTP FFS driver to the proper location.

Change-Id: I4b107b239bd9bc5699527f9c8c77d9079f264a7e
This commit is contained in:
bigbiff bigbiff
2018-12-18 18:39:53 -05:00
committed by Ethan Yonker
parent e9a49efe75
commit af32bb9c4f
114 changed files with 13199 additions and 1113 deletions
+10 -3
View File
@@ -55,9 +55,15 @@
#include "adbbu/libtwadbbu.hpp"
#ifdef TW_HAS_MTP
#include "mtp/mtp_MtpServer.hpp"
#include "mtp/twrpMtp.hpp"
#include "mtp/MtpMessage.hpp"
#ifdef TW_HAS_LEGACY_MTP
#include "mtp/legacy/mtp_MtpServer.hpp"
#include "mtp/legacy/twrpMtp.hpp"
#include "mtp/legacy/MtpMessage.hpp"
#else
#include "mtp/ffs/mtp_MtpServer.hpp"
#include "mtp/ffs/twrpMtp.hpp"
#include "mtp/ffs/MtpMessage.hpp"
#endif
#endif
extern "C" {
@@ -2315,6 +2321,7 @@ void TWPartitionManager::Add_All_MTP_Storage(void) {
bool TWPartitionManager::Disable_MTP(void) {
char old_value[PROPERTY_VALUE_MAX];
property_set("sys.usb.ffs.mtp.ready", "0");
property_get("sys.usb.config", old_value, "");
if (strcmp(old_value, "adb") != 0) {
char vendor[PROPERTY_VALUE_MAX];