Loading media/jni/android_mtp_MtpServer.cpp +16 −15 Original line number Diff line number Diff line Loading @@ -96,6 +96,8 @@ public: virtual bool threadLoop() { sMutex.lock(); while (!mDone) { mFd = open("/dev/mtp_usb", O_RDWR); printf("open returned %d\n", mFd); if (mFd < 0) { Loading @@ -107,7 +109,6 @@ public: mServer = new MtpServer(mFd, mDatabase, AID_MEDIA_RW, 0664, 0775); mServer->addStorage(mStoragePath, mReserveSpace); while (!mDone) { sMutex.unlock(); LOGD("MtpThread mServer->run"); Loading @@ -115,12 +116,12 @@ public: sleep(1); sMutex.lock(); } close(mFd); mFd = -1; delete mServer; mServer = NULL; } JNIEnv* env = AndroidRuntime::getJNIEnv(); env->SetIntField(mJavaServer, field_context, 0); Loading Loading
media/jni/android_mtp_MtpServer.cpp +16 −15 Original line number Diff line number Diff line Loading @@ -96,6 +96,8 @@ public: virtual bool threadLoop() { sMutex.lock(); while (!mDone) { mFd = open("/dev/mtp_usb", O_RDWR); printf("open returned %d\n", mFd); if (mFd < 0) { Loading @@ -107,7 +109,6 @@ public: mServer = new MtpServer(mFd, mDatabase, AID_MEDIA_RW, 0664, 0775); mServer->addStorage(mStoragePath, mReserveSpace); while (!mDone) { sMutex.unlock(); LOGD("MtpThread mServer->run"); Loading @@ -115,12 +116,12 @@ public: sleep(1); sMutex.lock(); } close(mFd); mFd = -1; delete mServer; mServer = NULL; } JNIEnv* env = AndroidRuntime::getJNIEnv(); env->SetIntField(mJavaServer, field_context, 0); Loading