diff options
-rw-r--r-- | media/java/android/mtp/MtpServer.java | 5 | ||||
-rw-r--r-- | media/jni/android_mtp_MtpServer.cpp | 22 |
2 files changed, 0 insertions, 27 deletions
diff --git a/media/java/android/mtp/MtpServer.java b/media/java/android/mtp/MtpServer.java index c065ca8..687cc44 100644 --- a/media/java/android/mtp/MtpServer.java +++ b/media/java/android/mtp/MtpServer.java @@ -61,10 +61,6 @@ public class MtpServer { native_send_object_removed(handle); } - public void setPtpMode(boolean usePtp) { - native_set_ptp_mode(usePtp); - } - public void addStorage(MtpStorage storage) { native_add_storage(storage); } @@ -78,7 +74,6 @@ public class MtpServer { private native final void native_stop(); private native final void native_send_object_added(int handle); private native final void native_send_object_removed(int handle); - private native final void native_set_ptp_mode(boolean usePtp); private native final void native_add_storage(MtpStorage storage); private native final void native_remove_storage(int storageId); } diff --git a/media/jni/android_mtp_MtpServer.cpp b/media/jni/android_mtp_MtpServer.cpp index 4d84cb7..e36e6db 100644 --- a/media/jni/android_mtp_MtpServer.cpp +++ b/media/jni/android_mtp_MtpServer.cpp @@ -70,14 +70,12 @@ private: MtpDatabase* mDatabase; MtpServer* mServer; MtpStorageList mStorageList; - bool mUsePtp; int mFd; public: MtpThread(MtpDatabase* database) : mDatabase(database), mServer(NULL), - mUsePtp(false), mFd(-1) { } @@ -85,10 +83,6 @@ public: virtual ~MtpThread() { } - void setPtpMode(bool usePtp) { - mUsePtp = usePtp; - } - void addStorage(MtpStorage *storage) { mStorageList.push(storage); if (mServer) @@ -119,9 +113,6 @@ public: mFd = open("/dev/mtp_usb", O_RDWR); if (mFd >= 0) { - ioctl(mFd, MTP_SET_INTERFACE_MODE, - (mUsePtp ? MTP_INTERFACE_MODE_PTP : MTP_INTERFACE_MODE_MTP)); - mServer = new MtpServer(mFd, mDatabase, AID_MEDIA_RW, 0664, 0775); for (size_t i = 0; i < mStorageList.size(); i++) { mServer->addStorage(mStorageList[i]); @@ -224,18 +215,6 @@ android_mtp_MtpServer_send_object_removed(JNIEnv *env, jobject thiz, jint handle } static void -android_mtp_MtpServer_set_ptp_mode(JNIEnv *env, jobject thiz, jboolean usePtp) -{ -#ifdef HAVE_ANDROID_OS - sMutex.lock(); - MtpThread *thread = sThread.get(); - if (thread) - thread->setPtpMode(usePtp); - sMutex.unlock(); -#endif -} - -static void android_mtp_MtpServer_add_storage(JNIEnv *env, jobject thiz, jobject jstorage) { #ifdef HAVE_ANDROID_OS @@ -290,7 +269,6 @@ static JNINativeMethod gMethods[] = { {"native_stop", "()V", (void *)android_mtp_MtpServer_stop}, {"native_send_object_added", "(I)V", (void *)android_mtp_MtpServer_send_object_added}, {"native_send_object_removed", "(I)V", (void *)android_mtp_MtpServer_send_object_removed}, - {"native_set_ptp_mode", "(Z)V", (void *)android_mtp_MtpServer_set_ptp_mode}, {"native_add_storage", "(Landroid/mtp/MtpStorage;)V", (void *)android_mtp_MtpServer_add_storage}, {"native_remove_storage", "(I)V", (void *)android_mtp_MtpServer_remove_storage}, |