Merge "MTP: Remove obsolete setPtpMode support"

This commit is contained in:
Mike Lockwood
2011-06-08 09:43:02 -07:00
committed by Android (Google) Code Review
2 changed files with 0 additions and 27 deletions

View File

@@ -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);
}

View File

@@ -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]);
@@ -223,18 +214,6 @@ android_mtp_MtpServer_send_object_removed(JNIEnv *env, jobject thiz, jint handle
#endif
}
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)
{
@@ -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},