Remove configure() from Mtp

Instead of configuring the server each
time the connection happens, UsbService
will now pass in the control fd with the
descriptors already written. Also, PTP
endpoints have been moved to their own
directory at /dev/usb-ffs/ptp rather than
using the same ones as mtp.

Bug: 72877174
Test: Verify PTP and MTP config changes work
Change-Id: I9a0336afd610aa397c9947568c308afb89b27c08
diff --git a/media/mtp/MtpFfsHandle.h b/media/mtp/MtpFfsHandle.h
index 2347000..24a8bd5 100644
--- a/media/mtp/MtpFfsHandle.h
+++ b/media/mtp/MtpFfsHandle.h
@@ -29,8 +29,6 @@
 
 namespace android {
 
-constexpr char FFS_MTP_EP0[] = "/dev/usb-ffs/mtp/ep0";
-
 constexpr int NUM_IO_BUFS = 2;
 
 struct io_buffer {
@@ -42,14 +40,10 @@
 };
 
 template <class T> class MtpFfsHandleTest;
-template <class T> class MtpFfsHandleTest_testControl_Test;
 
 class MtpFfsHandle : public IMtpHandle {
     template <class T> friend class MtpFfsHandleTest;
-    template <class T> friend class MtpFfsHandleTest_testControl_Test;
 protected:
-    bool initFunctionfs();
-    bool writeDescriptors();
     void closeConfig();
     void closeEndpoints();
     void advise(int fd);
@@ -58,15 +52,12 @@
     int handleEvent();
     void cancelTransaction();
     void doSendEvent(mtp_event me);
-    bool openEndpoints();
+    bool openEndpoints(bool ptp);
 
     static int getPacketSize(int ffs_fd);
 
-    bool mPtp;
     bool mCanceled;
 
-    std::timed_mutex mLock; // protects configure() vs main loop
-
     android::base::unique_fd mControl;
     // "in" from the host's perspective => sink for mtp server
     android::base::unique_fd mBulkIn;
@@ -99,12 +90,12 @@
     int sendFile(mtp_file_range mfr) override;
     int sendEvent(mtp_event me) override;
 
-    int start() override;
+    int start(bool ptp) override;
     void close() override;
 
-    int configure(bool ptp) override;
+    bool writeDescriptors(bool ptp);
 
-    MtpFfsHandle();
+    MtpFfsHandle(int controlFd);
     ~MtpFfsHandle();
 };