Refactored Mtp driver interface into multiple classes.
Added new interface for FunctionFS. This allows most of
the driver code to exist in userspace. The driver will
automatically use FunctionFS if it is enabled for that
device, otherwise it will default to the kernel driver.
The intention is to eventually deprecate the kernel driver.
Bug: 30976142
Change-Id: I36b8d16ca254fddd995b3ea1bd3d37b0ff4a28f7
Test: New automated tests for MtpFfsHandle, AsyncIO.
Manual testing on each device.
diff --git a/media/mtp/MtpDataPacket.h b/media/mtp/MtpDataPacket.h
index 6240f28..3a6b6cb 100644
--- a/media/mtp/MtpDataPacket.h
+++ b/media/mtp/MtpDataPacket.h
@@ -20,6 +20,7 @@
#include "MtpPacket.h"
#include "mtp.h"
+class IMtpHandle;
struct usb_device;
struct usb_request;
@@ -95,12 +96,12 @@
#ifdef MTP_DEVICE
- // fill our buffer with data from the given file descriptor
- int read(int fd);
+ // fill our buffer with data from the given usb handle
+ int read(IMtpHandle *h);
- // write our data to the given file descriptor
- int write(int fd);
- int writeData(int fd, void* data, uint32_t length);
+ // write our data to the given usb handle
+ int write(IMtpHandle *h);
+ int writeData(IMtpHandle *h, void* data, uint32_t length);
#endif
#ifdef MTP_HOST