From af32bb9c4f4f06e92de3435ed2db3153c0701094 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Tue, 18 Dec 2018 18:39:53 -0500 Subject: 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 --- mtp/ffs/Android.mk | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 mtp/ffs/Android.mk (limited to 'mtp/ffs/Android.mk') diff --git a/mtp/ffs/Android.mk b/mtp/ffs/Android.mk new file mode 100644 index 000000000..9e75e0d31 --- /dev/null +++ b/mtp/ffs/Android.mk @@ -0,0 +1,70 @@ +LOCAL_PATH := $(call my-dir) + +# Build libtwrpmtp library + +include $(CLEAR_VARS) +LOCAL_MODULE := libtwrpmtp-ffs +LOCAL_MODULE_TAGS := optional +LOCAL_CFLAGS = -D_FILE_OFFSET_BITS=64 -DMTP_DEVICE -DMTP_HOST -fno-strict-aliasing -Wno-unused-variable -Wno-format -Wno-unused-parameter -Wno-unused-private-field +LOCAL_C_INCLUDES += $(LOCAL_PATH) bionic frameworks/base/include system/core/include bionic/libc/private/ bootable/recovery/twrplibusbhost/include +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0) + LOCAL_C_INCLUDES += external/stlport/stlport + LOCAL_SHARED_LIBRARIES += libstlport +else + LOCAL_SHARED_LIBRARIES += libc++ +endif + +LOCAL_SRC_FILES = \ + MtpDataPacket.cpp \ + MtpDebug.cpp \ + MtpDevice.cpp \ + MtpDevHandle.cpp \ + MtpDeviceInfo.cpp \ + MtpEventPacket.cpp \ + MtpObjectInfo.cpp \ + MtpPacket.cpp \ + MtpProperty.cpp \ + MtpRequestPacket.cpp \ + MtpResponsePacket.cpp \ + MtpServer.cpp \ + MtpStorage.cpp \ + MtpStorageInfo.cpp \ + MtpStringBuffer.cpp \ + MtpUtils.cpp \ + mtp_MtpServer.cpp \ + btree.cpp \ + twrpMtp.cpp \ + mtp_MtpDatabase.cpp \ + node.cpp + +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0) + LOCAL_CFLAGS += -D_FFS_DEVICE + LOCAL_SHARED_LIBRARIES += libasyncio + LOCAL_SRC_FILES += \ + MtpDescriptors.cpp \ + MtpFfsHandle.cpp \ + MtpFfsCompatHandle.cpp \ + PosixAsyncIO.cpp +endif + +LOCAL_SHARED_LIBRARIES += libz \ + libc \ + libusbhost \ + libstdc++ \ + libdl \ + libcutils \ + libutils \ + libaosprecovery \ + libselinux \ + libbase + +LOCAL_C_INCLUDES += bootable/recovery/twrplibusbhost/include + +ifneq ($(TW_MTP_DEVICE),) + LOCAL_CFLAGS += -DUSB_MTP_DEVICE=$(TW_MTP_DEVICE) +endif +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0) + LOCAL_CFLAGS += -DHAS_USBHOST_TIMEOUT +endif + +include $(BUILD_SHARED_LIBRARY) -- cgit v1.2.3