Loading media/java/android/mtp/MtpDatabase.java +1 −18 Original line number Diff line number Diff line Loading @@ -222,7 +222,6 @@ public class MtpDatabase { private int[] getObjectList(int storageID, int format, int parent) { // we can ignore storageID until we support multiple storages Log.d(TAG, "getObjectList parent: " + parent); Cursor c = null; try { if (format != 0) { Loading @@ -235,7 +234,6 @@ public class MtpDatabase { PARENT_WHERE, new String[] { Integer.toString(parent) }, null); } if (c == null) { Log.d(TAG, "null cursor"); return null; } int count = c.getCount(); Loading @@ -245,7 +243,6 @@ public class MtpDatabase { c.moveToNext(); result[i] = c.getInt(0); } Log.d(TAG, "returning " + result); return result; } } catch (RemoteException e) { Loading @@ -260,7 +257,6 @@ public class MtpDatabase { private int getNumObjects(int storageID, int format, int parent) { // we can ignore storageID until we support multiple storages Log.d(TAG, "getObjectList parent: " + parent); Cursor c = null; try { if (format != 0) { Loading Loading @@ -529,8 +525,8 @@ public class MtpDatabase { String newPath = path.substring(0, lastSlash + 1) + newName; File newFile = new File(newPath); boolean success = oldFile.renameTo(newFile); Log.d(TAG, "renaming "+ path + " to " + newPath + (success ? " succeeded" : " failed")); if (!success) { Log.w(TAG, "renaming "+ path + " to " + newPath + " failed"); return MtpConstants.RESPONSE_GENERAL_ERROR; } Loading @@ -557,8 +553,6 @@ public class MtpDatabase { private int setObjectProperty(int handle, int property, long intValue, String stringValue) { Log.d(TAG, "setObjectProperty: " + property); switch (property) { case MtpConstants.PROPERTY_OBJECT_FILE_NAME: return renameFile(handle, stringValue); Loading @@ -569,8 +563,6 @@ public class MtpDatabase { } private int getDeviceProperty(int property, long[] outIntValue, char[] outStringValue) { Log.d(TAG, "getDeviceProperty: " + property); switch (property) { case MtpConstants.DEVICE_PROPERTY_SYNCHRONIZATION_PARTNER: case MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME: Loading Loading @@ -616,8 +608,6 @@ public class MtpDatabase { } private int setDeviceProperty(int property, long intValue, String stringValue) { Log.d(TAG, "setDeviceProperty: " + property + " : " + stringValue); switch (property) { case MtpConstants.DEVICE_PROPERTY_SYNCHRONIZATION_PARTNER: case MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME: Loading @@ -638,7 +628,6 @@ public class MtpDatabase { private boolean getObjectInfo(int handle, int[] outStorageFormatParent, char[] outName, long[] outSizeModified) { Log.d(TAG, "getObjectInfo: " + handle); Cursor c = null; try { c = mMediaProvider.query(mObjectsUri, OBJECT_INFO_PROJECTION, Loading Loading @@ -674,7 +663,6 @@ public class MtpDatabase { } private int getObjectFilePath(int handle, char[] outFilePath, long[] outFileLengthFormat) { Log.d(TAG, "getObjectFilePath: " + handle); if (handle == 0) { // special case root directory mMediaStoragePath.getChars(0, mMediaStoragePath.length(), outFilePath, 0); Loading Loading @@ -708,7 +696,6 @@ public class MtpDatabase { } private int deleteFile(int handle) { Log.d(TAG, "deleteFile: " + handle); mDatabaseModified = true; String path = null; int format = 0; Loading Loading @@ -754,7 +741,6 @@ public class MtpDatabase { } private int[] getObjectReferences(int handle) { Log.d(TAG, "getObjectReferences for: " + handle); Uri uri = Files.getMtpReferencesUri(mVolumeName, handle); Cursor c = null; try { Loading Loading @@ -802,14 +788,11 @@ public class MtpDatabase { } private void sessionStarted() { Log.d(TAG, "sessionStarted"); mDatabaseModified = false; } private void sessionEnded() { Log.d(TAG, "sessionEnded"); if (mDatabaseModified) { Log.d(TAG, "sending ACTION_MTP_SESSION_END"); mContext.sendBroadcast(new Intent(MediaStore.ACTION_MTP_SESSION_END)); mDatabaseModified = false; } Loading media/java/android/mtp/MtpServer.java +0 −9 Original line number Diff line number Diff line Loading @@ -34,15 +34,6 @@ public class MtpServer { native_setup(database, storagePath, reserveSpace); } @Override protected void finalize() throws Throwable { try { native_finalize(); } finally { super.finalize(); } } public void start() { native_start(); } Loading media/jni/android_mtp_MtpDatabase.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -1031,7 +1031,6 @@ static void android_mtp_MtpDatabase_setup(JNIEnv *env, jobject thiz) { #ifdef HAVE_ANDROID_OS LOGD("setup\n"); MyMtpDatabase* database = new MyMtpDatabase(env, thiz); env->SetIntField(thiz, field_context, (int)database); checkAndClearExceptionFromCallback(env, __FUNCTION__); Loading @@ -1042,7 +1041,6 @@ static void android_mtp_MtpDatabase_finalize(JNIEnv *env, jobject thiz) { #ifdef HAVE_ANDROID_OS LOGD("finalize\n"); MyMtpDatabase* database = (MyMtpDatabase *)env->GetIntField(thiz, field_context); database->cleanup(env); delete database; Loading Loading @@ -1081,8 +1079,6 @@ int register_android_mtp_MtpDatabase(JNIEnv *env) { jclass clazz; LOGD("register_android_mtp_MtpDatabase\n"); clazz = env->FindClass("android/mtp/MtpDatabase"); if (clazz == NULL) { LOGE("Can't find android/mtp/MtpDatabase"); Loading media/jni/android_mtp_MtpServer.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -111,7 +111,6 @@ public: sMutex.unlock(); LOGD("MtpThread mServer->run"); mServer->run(); sleep(1); Loading @@ -128,7 +127,6 @@ public: env->DeleteGlobalRef(mJavaServer); sMutex.unlock(); LOGD("threadLoop returning"); return false; } Loading Loading @@ -160,8 +158,6 @@ android_mtp_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase, jstring storagePath, jlong reserveSpace) { #ifdef HAVE_ANDROID_OS LOGD("setup\n"); MtpDatabase* database = getMtpDatabase(env, javaDatabase); const char *storagePathStr = env->GetStringUTFChars(storagePath, NULL); Loading @@ -173,18 +169,10 @@ android_mtp_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase, #endif } static void android_mtp_MtpServer_finalize(JNIEnv *env, jobject thiz) { LOGD("finalize\n"); } static void android_mtp_MtpServer_start(JNIEnv *env, jobject thiz) { #ifdef HAVE_ANDROID_OS LOGD("start\n"); MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); thread->run("MtpThread"); #endif // HAVE_ANDROID_OS Loading @@ -194,7 +182,6 @@ static void android_mtp_MtpServer_stop(JNIEnv *env, jobject thiz) { #ifdef HAVE_ANDROID_OS LOGD("stop\n"); MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); if (thread) thread->stop(); Loading Loading @@ -225,7 +212,6 @@ static void android_mtp_MtpServer_set_ptp_mode(JNIEnv *env, jobject thiz, jboolean usePtp) { #ifdef HAVE_ANDROID_OS LOGD("set_ptp_mode\n"); MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); if (thread) thread->setPtpMode(usePtp); Loading @@ -237,7 +223,6 @@ android_mtp_MtpServer_set_ptp_mode(JNIEnv *env, jobject thiz, jboolean usePtp) static JNINativeMethod gMethods[] = { {"native_setup", "(Landroid/mtp/MtpDatabase;Ljava/lang/String;J)V", (void *)android_mtp_MtpServer_setup}, {"native_finalize", "()V", (void *)android_mtp_MtpServer_finalize}, {"native_start", "()V", (void *)android_mtp_MtpServer_start}, {"native_stop", "()V", (void *)android_mtp_MtpServer_stop}, {"native_send_object_added", "(I)V", (void *)android_mtp_MtpServer_send_object_added}, Loading @@ -251,8 +236,6 @@ int register_android_mtp_MtpServer(JNIEnv *env) { jclass clazz; LOGD("register_android_mtp_MtpServer\n"); clazz = env->FindClass("android/mtp/MtpServer"); if (clazz == NULL) { LOGE("Can't find android/mtp/MtpServer"); Loading media/mtp/MtpServer.cpp +15 −15 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ void MtpServer::run() { while (1) { int ret = mRequest.read(fd); if (ret < 0) { LOGE("request read returned %d, errno: %d", ret, errno); LOGV("request read returned %d, errno: %d", ret, errno); if (errno == ECANCELED) { // return to top of loop and wait for next command continue; Loading Loading @@ -204,23 +204,23 @@ void MtpServer::run() { void MtpServer::sendObjectAdded(MtpObjectHandle handle) { if (mSessionOpen) { LOGD("sendObjectAdded %d\n", handle); LOGV("sendObjectAdded %d\n", handle); mEvent.setEventCode(MTP_EVENT_OBJECT_ADDED); mEvent.setTransactionID(mRequest.getTransactionID()); mEvent.setParameter(1, handle); int ret = mEvent.write(mFD); LOGD("mEvent.write returned %d\n", ret); LOGV("mEvent.write returned %d\n", ret); } } void MtpServer::sendObjectRemoved(MtpObjectHandle handle) { if (mSessionOpen) { LOGD("sendObjectRemoved %d\n", handle); LOGV("sendObjectRemoved %d\n", handle); mEvent.setEventCode(MTP_EVENT_OBJECT_REMOVED); mEvent.setTransactionID(mRequest.getTransactionID()); mEvent.setParameter(1, handle); int ret = mEvent.write(mFD); LOGD("mEvent.write returned %d\n", ret); LOGV("mEvent.write returned %d\n", ret); } } Loading Loading @@ -496,7 +496,7 @@ MtpResponseCode MtpServer::doSetObjectReferences() { MtpResponseCode MtpServer::doGetObjectPropValue() { MtpObjectHandle handle = mRequest.getParameter(1); MtpObjectProperty property = mRequest.getParameter(2); LOGD("GetObjectPropValue %d %s\n", handle, LOGV("GetObjectPropValue %d %s\n", handle, MtpDebug::getObjectPropCodeName(property)); return mDatabase->getObjectPropertyValue(handle, property, mData); Loading @@ -505,7 +505,7 @@ MtpResponseCode MtpServer::doGetObjectPropValue() { MtpResponseCode MtpServer::doSetObjectPropValue() { MtpObjectHandle handle = mRequest.getParameter(1); MtpObjectProperty property = mRequest.getParameter(2); LOGD("SetObjectPropValue %d %s\n", handle, LOGV("SetObjectPropValue %d %s\n", handle, MtpDebug::getObjectPropCodeName(property)); return mDatabase->setObjectPropertyValue(handle, property, mData); Loading @@ -513,7 +513,7 @@ MtpResponseCode MtpServer::doSetObjectPropValue() { MtpResponseCode MtpServer::doGetDevicePropValue() { MtpDeviceProperty property = mRequest.getParameter(1); LOGD("GetDevicePropValue %s\n", LOGV("GetDevicePropValue %s\n", MtpDebug::getDevicePropCodeName(property)); return mDatabase->getDevicePropertyValue(property, mData); Loading @@ -521,7 +521,7 @@ MtpResponseCode MtpServer::doGetDevicePropValue() { MtpResponseCode MtpServer::doSetDevicePropValue() { MtpDeviceProperty property = mRequest.getParameter(1); LOGD("SetDevicePropValue %s\n", LOGV("SetDevicePropValue %s\n", MtpDebug::getDevicePropCodeName(property)); return mDatabase->setDevicePropertyValue(property, mData); Loading @@ -529,7 +529,7 @@ MtpResponseCode MtpServer::doSetDevicePropValue() { MtpResponseCode MtpServer::doResetDevicePropValue() { MtpDeviceProperty property = mRequest.getParameter(1); LOGD("ResetDevicePropValue %s\n", LOGV("ResetDevicePropValue %s\n", MtpDebug::getDevicePropCodeName(property)); return mDatabase->resetDeviceProperty(property); Loading @@ -543,7 +543,7 @@ MtpResponseCode MtpServer::doGetObjectPropList() { uint32_t property = mRequest.getParameter(3); int groupCode = mRequest.getParameter(4); int depth = mRequest.getParameter(5); LOGD("GetObjectPropList %d format: %s property: %s group: %d depth: %d\n", LOGV("GetObjectPropList %d format: %s property: %s group: %d depth: %d\n", handle, MtpDebug::getFormatCodeName(format), MtpDebug::getObjectPropCodeName(property), groupCode, depth); Loading Loading @@ -674,7 +674,7 @@ MtpResponseCode MtpServer::doSendObjectInfo() { mData.getString(modified); // date modified // keywords follow LOGD("name: %s format: %04X\n", (const char *)name, format); LOGV("name: %s format: %04X\n", (const char *)name, format); time_t modifiedTime; if (!parseDateTime(modified, modifiedTime)) modifiedTime = 0; Loading Loading @@ -750,7 +750,7 @@ MtpResponseCode MtpServer::doSendObject() { mfr.offset = 0; mfr.length = mSendObjectFileSize; LOGD("receiving %s\n", (const char *)mSendObjectFilePath); LOGV("receiving %s\n", (const char *)mSendObjectFilePath); // transfer the file ret = ioctl(mFD, MTP_RECEIVE_FILE, (unsigned long)&mfr); close(mfr.fd); Loading Loading @@ -854,7 +854,7 @@ MtpResponseCode MtpServer::doDeleteObject() { MtpResponseCode MtpServer::doGetObjectPropDesc() { MtpObjectProperty propCode = mRequest.getParameter(1); MtpObjectFormat format = mRequest.getParameter(2); LOGD("GetObjectPropDesc %s %s\n", MtpDebug::getObjectPropCodeName(propCode), LOGV("GetObjectPropDesc %s %s\n", MtpDebug::getObjectPropCodeName(propCode), MtpDebug::getFormatCodeName(format)); MtpProperty* property = mDatabase->getObjectPropertyDesc(propCode, format); if (!property) Loading @@ -866,7 +866,7 @@ MtpResponseCode MtpServer::doGetObjectPropDesc() { MtpResponseCode MtpServer::doGetDevicePropDesc() { MtpDeviceProperty propCode = mRequest.getParameter(1); LOGD("GetDevicePropDesc %s\n", MtpDebug::getDevicePropCodeName(propCode)); LOGV("GetDevicePropDesc %s\n", MtpDebug::getDevicePropCodeName(propCode)); MtpProperty* property = mDatabase->getDevicePropertyDesc(propCode); if (!property) return MTP_RESPONSE_DEVICE_PROP_NOT_SUPPORTED; Loading Loading
media/java/android/mtp/MtpDatabase.java +1 −18 Original line number Diff line number Diff line Loading @@ -222,7 +222,6 @@ public class MtpDatabase { private int[] getObjectList(int storageID, int format, int parent) { // we can ignore storageID until we support multiple storages Log.d(TAG, "getObjectList parent: " + parent); Cursor c = null; try { if (format != 0) { Loading @@ -235,7 +234,6 @@ public class MtpDatabase { PARENT_WHERE, new String[] { Integer.toString(parent) }, null); } if (c == null) { Log.d(TAG, "null cursor"); return null; } int count = c.getCount(); Loading @@ -245,7 +243,6 @@ public class MtpDatabase { c.moveToNext(); result[i] = c.getInt(0); } Log.d(TAG, "returning " + result); return result; } } catch (RemoteException e) { Loading @@ -260,7 +257,6 @@ public class MtpDatabase { private int getNumObjects(int storageID, int format, int parent) { // we can ignore storageID until we support multiple storages Log.d(TAG, "getObjectList parent: " + parent); Cursor c = null; try { if (format != 0) { Loading Loading @@ -529,8 +525,8 @@ public class MtpDatabase { String newPath = path.substring(0, lastSlash + 1) + newName; File newFile = new File(newPath); boolean success = oldFile.renameTo(newFile); Log.d(TAG, "renaming "+ path + " to " + newPath + (success ? " succeeded" : " failed")); if (!success) { Log.w(TAG, "renaming "+ path + " to " + newPath + " failed"); return MtpConstants.RESPONSE_GENERAL_ERROR; } Loading @@ -557,8 +553,6 @@ public class MtpDatabase { private int setObjectProperty(int handle, int property, long intValue, String stringValue) { Log.d(TAG, "setObjectProperty: " + property); switch (property) { case MtpConstants.PROPERTY_OBJECT_FILE_NAME: return renameFile(handle, stringValue); Loading @@ -569,8 +563,6 @@ public class MtpDatabase { } private int getDeviceProperty(int property, long[] outIntValue, char[] outStringValue) { Log.d(TAG, "getDeviceProperty: " + property); switch (property) { case MtpConstants.DEVICE_PROPERTY_SYNCHRONIZATION_PARTNER: case MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME: Loading Loading @@ -616,8 +608,6 @@ public class MtpDatabase { } private int setDeviceProperty(int property, long intValue, String stringValue) { Log.d(TAG, "setDeviceProperty: " + property + " : " + stringValue); switch (property) { case MtpConstants.DEVICE_PROPERTY_SYNCHRONIZATION_PARTNER: case MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME: Loading @@ -638,7 +628,6 @@ public class MtpDatabase { private boolean getObjectInfo(int handle, int[] outStorageFormatParent, char[] outName, long[] outSizeModified) { Log.d(TAG, "getObjectInfo: " + handle); Cursor c = null; try { c = mMediaProvider.query(mObjectsUri, OBJECT_INFO_PROJECTION, Loading Loading @@ -674,7 +663,6 @@ public class MtpDatabase { } private int getObjectFilePath(int handle, char[] outFilePath, long[] outFileLengthFormat) { Log.d(TAG, "getObjectFilePath: " + handle); if (handle == 0) { // special case root directory mMediaStoragePath.getChars(0, mMediaStoragePath.length(), outFilePath, 0); Loading Loading @@ -708,7 +696,6 @@ public class MtpDatabase { } private int deleteFile(int handle) { Log.d(TAG, "deleteFile: " + handle); mDatabaseModified = true; String path = null; int format = 0; Loading Loading @@ -754,7 +741,6 @@ public class MtpDatabase { } private int[] getObjectReferences(int handle) { Log.d(TAG, "getObjectReferences for: " + handle); Uri uri = Files.getMtpReferencesUri(mVolumeName, handle); Cursor c = null; try { Loading Loading @@ -802,14 +788,11 @@ public class MtpDatabase { } private void sessionStarted() { Log.d(TAG, "sessionStarted"); mDatabaseModified = false; } private void sessionEnded() { Log.d(TAG, "sessionEnded"); if (mDatabaseModified) { Log.d(TAG, "sending ACTION_MTP_SESSION_END"); mContext.sendBroadcast(new Intent(MediaStore.ACTION_MTP_SESSION_END)); mDatabaseModified = false; } Loading
media/java/android/mtp/MtpServer.java +0 −9 Original line number Diff line number Diff line Loading @@ -34,15 +34,6 @@ public class MtpServer { native_setup(database, storagePath, reserveSpace); } @Override protected void finalize() throws Throwable { try { native_finalize(); } finally { super.finalize(); } } public void start() { native_start(); } Loading
media/jni/android_mtp_MtpDatabase.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -1031,7 +1031,6 @@ static void android_mtp_MtpDatabase_setup(JNIEnv *env, jobject thiz) { #ifdef HAVE_ANDROID_OS LOGD("setup\n"); MyMtpDatabase* database = new MyMtpDatabase(env, thiz); env->SetIntField(thiz, field_context, (int)database); checkAndClearExceptionFromCallback(env, __FUNCTION__); Loading @@ -1042,7 +1041,6 @@ static void android_mtp_MtpDatabase_finalize(JNIEnv *env, jobject thiz) { #ifdef HAVE_ANDROID_OS LOGD("finalize\n"); MyMtpDatabase* database = (MyMtpDatabase *)env->GetIntField(thiz, field_context); database->cleanup(env); delete database; Loading Loading @@ -1081,8 +1079,6 @@ int register_android_mtp_MtpDatabase(JNIEnv *env) { jclass clazz; LOGD("register_android_mtp_MtpDatabase\n"); clazz = env->FindClass("android/mtp/MtpDatabase"); if (clazz == NULL) { LOGE("Can't find android/mtp/MtpDatabase"); Loading
media/jni/android_mtp_MtpServer.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -111,7 +111,6 @@ public: sMutex.unlock(); LOGD("MtpThread mServer->run"); mServer->run(); sleep(1); Loading @@ -128,7 +127,6 @@ public: env->DeleteGlobalRef(mJavaServer); sMutex.unlock(); LOGD("threadLoop returning"); return false; } Loading Loading @@ -160,8 +158,6 @@ android_mtp_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase, jstring storagePath, jlong reserveSpace) { #ifdef HAVE_ANDROID_OS LOGD("setup\n"); MtpDatabase* database = getMtpDatabase(env, javaDatabase); const char *storagePathStr = env->GetStringUTFChars(storagePath, NULL); Loading @@ -173,18 +169,10 @@ android_mtp_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase, #endif } static void android_mtp_MtpServer_finalize(JNIEnv *env, jobject thiz) { LOGD("finalize\n"); } static void android_mtp_MtpServer_start(JNIEnv *env, jobject thiz) { #ifdef HAVE_ANDROID_OS LOGD("start\n"); MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); thread->run("MtpThread"); #endif // HAVE_ANDROID_OS Loading @@ -194,7 +182,6 @@ static void android_mtp_MtpServer_stop(JNIEnv *env, jobject thiz) { #ifdef HAVE_ANDROID_OS LOGD("stop\n"); MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); if (thread) thread->stop(); Loading Loading @@ -225,7 +212,6 @@ static void android_mtp_MtpServer_set_ptp_mode(JNIEnv *env, jobject thiz, jboolean usePtp) { #ifdef HAVE_ANDROID_OS LOGD("set_ptp_mode\n"); MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context); if (thread) thread->setPtpMode(usePtp); Loading @@ -237,7 +223,6 @@ android_mtp_MtpServer_set_ptp_mode(JNIEnv *env, jobject thiz, jboolean usePtp) static JNINativeMethod gMethods[] = { {"native_setup", "(Landroid/mtp/MtpDatabase;Ljava/lang/String;J)V", (void *)android_mtp_MtpServer_setup}, {"native_finalize", "()V", (void *)android_mtp_MtpServer_finalize}, {"native_start", "()V", (void *)android_mtp_MtpServer_start}, {"native_stop", "()V", (void *)android_mtp_MtpServer_stop}, {"native_send_object_added", "(I)V", (void *)android_mtp_MtpServer_send_object_added}, Loading @@ -251,8 +236,6 @@ int register_android_mtp_MtpServer(JNIEnv *env) { jclass clazz; LOGD("register_android_mtp_MtpServer\n"); clazz = env->FindClass("android/mtp/MtpServer"); if (clazz == NULL) { LOGE("Can't find android/mtp/MtpServer"); Loading
media/mtp/MtpServer.cpp +15 −15 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ void MtpServer::run() { while (1) { int ret = mRequest.read(fd); if (ret < 0) { LOGE("request read returned %d, errno: %d", ret, errno); LOGV("request read returned %d, errno: %d", ret, errno); if (errno == ECANCELED) { // return to top of loop and wait for next command continue; Loading Loading @@ -204,23 +204,23 @@ void MtpServer::run() { void MtpServer::sendObjectAdded(MtpObjectHandle handle) { if (mSessionOpen) { LOGD("sendObjectAdded %d\n", handle); LOGV("sendObjectAdded %d\n", handle); mEvent.setEventCode(MTP_EVENT_OBJECT_ADDED); mEvent.setTransactionID(mRequest.getTransactionID()); mEvent.setParameter(1, handle); int ret = mEvent.write(mFD); LOGD("mEvent.write returned %d\n", ret); LOGV("mEvent.write returned %d\n", ret); } } void MtpServer::sendObjectRemoved(MtpObjectHandle handle) { if (mSessionOpen) { LOGD("sendObjectRemoved %d\n", handle); LOGV("sendObjectRemoved %d\n", handle); mEvent.setEventCode(MTP_EVENT_OBJECT_REMOVED); mEvent.setTransactionID(mRequest.getTransactionID()); mEvent.setParameter(1, handle); int ret = mEvent.write(mFD); LOGD("mEvent.write returned %d\n", ret); LOGV("mEvent.write returned %d\n", ret); } } Loading Loading @@ -496,7 +496,7 @@ MtpResponseCode MtpServer::doSetObjectReferences() { MtpResponseCode MtpServer::doGetObjectPropValue() { MtpObjectHandle handle = mRequest.getParameter(1); MtpObjectProperty property = mRequest.getParameter(2); LOGD("GetObjectPropValue %d %s\n", handle, LOGV("GetObjectPropValue %d %s\n", handle, MtpDebug::getObjectPropCodeName(property)); return mDatabase->getObjectPropertyValue(handle, property, mData); Loading @@ -505,7 +505,7 @@ MtpResponseCode MtpServer::doGetObjectPropValue() { MtpResponseCode MtpServer::doSetObjectPropValue() { MtpObjectHandle handle = mRequest.getParameter(1); MtpObjectProperty property = mRequest.getParameter(2); LOGD("SetObjectPropValue %d %s\n", handle, LOGV("SetObjectPropValue %d %s\n", handle, MtpDebug::getObjectPropCodeName(property)); return mDatabase->setObjectPropertyValue(handle, property, mData); Loading @@ -513,7 +513,7 @@ MtpResponseCode MtpServer::doSetObjectPropValue() { MtpResponseCode MtpServer::doGetDevicePropValue() { MtpDeviceProperty property = mRequest.getParameter(1); LOGD("GetDevicePropValue %s\n", LOGV("GetDevicePropValue %s\n", MtpDebug::getDevicePropCodeName(property)); return mDatabase->getDevicePropertyValue(property, mData); Loading @@ -521,7 +521,7 @@ MtpResponseCode MtpServer::doGetDevicePropValue() { MtpResponseCode MtpServer::doSetDevicePropValue() { MtpDeviceProperty property = mRequest.getParameter(1); LOGD("SetDevicePropValue %s\n", LOGV("SetDevicePropValue %s\n", MtpDebug::getDevicePropCodeName(property)); return mDatabase->setDevicePropertyValue(property, mData); Loading @@ -529,7 +529,7 @@ MtpResponseCode MtpServer::doSetDevicePropValue() { MtpResponseCode MtpServer::doResetDevicePropValue() { MtpDeviceProperty property = mRequest.getParameter(1); LOGD("ResetDevicePropValue %s\n", LOGV("ResetDevicePropValue %s\n", MtpDebug::getDevicePropCodeName(property)); return mDatabase->resetDeviceProperty(property); Loading @@ -543,7 +543,7 @@ MtpResponseCode MtpServer::doGetObjectPropList() { uint32_t property = mRequest.getParameter(3); int groupCode = mRequest.getParameter(4); int depth = mRequest.getParameter(5); LOGD("GetObjectPropList %d format: %s property: %s group: %d depth: %d\n", LOGV("GetObjectPropList %d format: %s property: %s group: %d depth: %d\n", handle, MtpDebug::getFormatCodeName(format), MtpDebug::getObjectPropCodeName(property), groupCode, depth); Loading Loading @@ -674,7 +674,7 @@ MtpResponseCode MtpServer::doSendObjectInfo() { mData.getString(modified); // date modified // keywords follow LOGD("name: %s format: %04X\n", (const char *)name, format); LOGV("name: %s format: %04X\n", (const char *)name, format); time_t modifiedTime; if (!parseDateTime(modified, modifiedTime)) modifiedTime = 0; Loading Loading @@ -750,7 +750,7 @@ MtpResponseCode MtpServer::doSendObject() { mfr.offset = 0; mfr.length = mSendObjectFileSize; LOGD("receiving %s\n", (const char *)mSendObjectFilePath); LOGV("receiving %s\n", (const char *)mSendObjectFilePath); // transfer the file ret = ioctl(mFD, MTP_RECEIVE_FILE, (unsigned long)&mfr); close(mfr.fd); Loading Loading @@ -854,7 +854,7 @@ MtpResponseCode MtpServer::doDeleteObject() { MtpResponseCode MtpServer::doGetObjectPropDesc() { MtpObjectProperty propCode = mRequest.getParameter(1); MtpObjectFormat format = mRequest.getParameter(2); LOGD("GetObjectPropDesc %s %s\n", MtpDebug::getObjectPropCodeName(propCode), LOGV("GetObjectPropDesc %s %s\n", MtpDebug::getObjectPropCodeName(propCode), MtpDebug::getFormatCodeName(format)); MtpProperty* property = mDatabase->getObjectPropertyDesc(propCode, format); if (!property) Loading @@ -866,7 +866,7 @@ MtpResponseCode MtpServer::doGetObjectPropDesc() { MtpResponseCode MtpServer::doGetDevicePropDesc() { MtpDeviceProperty propCode = mRequest.getParameter(1); LOGD("GetDevicePropDesc %s\n", MtpDebug::getDevicePropCodeName(propCode)); LOGV("GetDevicePropDesc %s\n", MtpDebug::getDevicePropCodeName(propCode)); MtpProperty* property = mDatabase->getDevicePropertyDesc(propCode); if (!property) return MTP_RESPONSE_DEVICE_PROP_NOT_SUPPORTED; Loading