Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -18115,7 +18115,7 @@ package android.mtp { method public boolean importFile(int, java.lang.String); method public boolean importFile(int, android.os.ParcelFileDescriptor); method public boolean open(android.hardware.usb.UsbDeviceConnection); method public boolean sendObject(int, android.os.ParcelFileDescriptor); method public boolean sendObject(int, int, android.os.ParcelFileDescriptor); method public android.mtp.MtpObjectInfo sendObjectInfo(android.mtp.MtpObjectInfo); } api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -19627,7 +19627,7 @@ package android.mtp { method public boolean importFile(int, java.lang.String); method public boolean importFile(int, android.os.ParcelFileDescriptor); method public boolean open(android.hardware.usb.UsbDeviceConnection); method public boolean sendObject(int, android.os.ParcelFileDescriptor); method public boolean sendObject(int, int, android.os.ParcelFileDescriptor); method public android.mtp.MtpObjectInfo sendObjectInfo(android.mtp.MtpObjectInfo); } media/java/android/mtp/MtpDevice.java +4 −3 Original line number Diff line number Diff line Loading @@ -257,11 +257,12 @@ public final class MtpDevice { * on completion, and must be done by the caller. * * @param objectHandle handle of the target file * @param size size of the file in bytes * @param descriptor file descriptor to read the data from. * @return true if the file transfer succeeds */ public boolean sendObject(int objectHandle, ParcelFileDescriptor descriptor) { return native_send_object(objectHandle, descriptor.getFd()); public boolean sendObject(int objectHandle, int size, ParcelFileDescriptor descriptor) { return native_send_object(objectHandle, size, descriptor.getFd()); } /** Loading Loading @@ -294,6 +295,6 @@ public final class MtpDevice { private native long native_get_storage_id(int objectHandle); private native boolean native_import_file(int objectHandle, String destPath); private native boolean native_import_file(int objectHandle, int fd); private native boolean native_send_object(int objectHandle, int fd); private native boolean native_send_object(int objectHandle, int size, int fd); private native MtpObjectInfo native_send_object_info(MtpObjectInfo info); } media/java/android/mtp/MtpObjectInfo.java +19 −19 Original line number Diff line number Diff line Loading @@ -273,25 +273,25 @@ public final class MtpObjectInfo { public Builder(MtpObjectInfo objectInfo) { mObjectInfo = new MtpObjectInfo(); mObjectInfo.mHandle = -1; mObjectInfo.mAssociationDesc = mObjectInfo.mAssociationDesc; mObjectInfo.mAssociationType = mObjectInfo.mAssociationType; mObjectInfo.mCompressedSize = mObjectInfo.mCompressedSize; mObjectInfo.mDateCreated = mObjectInfo.mDateCreated; mObjectInfo.mDateModified = mObjectInfo.mDateModified; mObjectInfo.mFormat = mObjectInfo.mFormat; mObjectInfo.mImagePixDepth = mObjectInfo.mImagePixDepth; mObjectInfo.mImagePixHeight = mObjectInfo.mImagePixHeight; mObjectInfo.mImagePixWidth = mObjectInfo.mImagePixWidth; mObjectInfo.mKeywords = mObjectInfo.mKeywords; mObjectInfo.mName = mObjectInfo.mName; mObjectInfo.mParent = mObjectInfo.mParent; mObjectInfo.mProtectionStatus = mObjectInfo.mProtectionStatus; mObjectInfo.mSequenceNumber = mObjectInfo.mSequenceNumber; mObjectInfo.mStorageId = mObjectInfo.mStorageId; mObjectInfo.mThumbCompressedSize = mObjectInfo.mThumbCompressedSize; mObjectInfo.mThumbFormat = mObjectInfo.mThumbFormat; mObjectInfo.mThumbPixHeight = mObjectInfo.mThumbPixHeight; mObjectInfo.mThumbPixWidth = mObjectInfo.mThumbPixWidth; mObjectInfo.mAssociationDesc = objectInfo.mAssociationDesc; mObjectInfo.mAssociationType = objectInfo.mAssociationType; mObjectInfo.mCompressedSize = objectInfo.mCompressedSize; mObjectInfo.mDateCreated = objectInfo.mDateCreated; mObjectInfo.mDateModified = objectInfo.mDateModified; mObjectInfo.mFormat = objectInfo.mFormat; mObjectInfo.mImagePixDepth = objectInfo.mImagePixDepth; mObjectInfo.mImagePixHeight = objectInfo.mImagePixHeight; mObjectInfo.mImagePixWidth = objectInfo.mImagePixWidth; mObjectInfo.mKeywords = objectInfo.mKeywords; mObjectInfo.mName = objectInfo.mName; mObjectInfo.mParent = objectInfo.mParent; mObjectInfo.mProtectionStatus = objectInfo.mProtectionStatus; mObjectInfo.mSequenceNumber = objectInfo.mSequenceNumber; mObjectInfo.mStorageId = objectInfo.mStorageId; mObjectInfo.mThumbCompressedSize = objectInfo.mThumbCompressedSize; mObjectInfo.mThumbFormat = objectInfo.mThumbFormat; mObjectInfo.mThumbPixHeight = objectInfo.mThumbPixHeight; mObjectInfo.mThumbPixWidth = objectInfo.mThumbPixWidth; } public Builder setAssociationDesc(int value) { Loading media/jni/android_mtp_MtpDevice.cpp +3 −8 Original line number Diff line number Diff line Loading @@ -412,18 +412,13 @@ android_mtp_MtpDevice_import_file_to_fd(JNIEnv *env, jobject thiz, jint object_i } static jboolean android_mtp_MtpDevice_send_object(JNIEnv *env, jobject thiz, jint object_id, jint fd) android_mtp_MtpDevice_send_object(JNIEnv *env, jobject thiz, jint object_id, jint size, jint fd) { MtpDevice* device = get_device_from_object(env, thiz); if (!device) return JNI_FALSE; MtpObjectInfo* object_info = device->getObjectInfo(object_id); if (!object_info) return JNI_FALSE; bool result = device->sendObject(object_info, fd); delete object_info; return result; return device->sendObject(object_id, size, fd); } static jobject Loading Loading @@ -516,7 +511,7 @@ static JNINativeMethod gMethods[] = { {"native_import_file", "(ILjava/lang/String;)Z", (void *)android_mtp_MtpDevice_import_file}, {"native_import_file", "(II)Z",(void *)android_mtp_MtpDevice_import_file_to_fd}, {"native_send_object", "(II)Z",(void *)android_mtp_MtpDevice_send_object}, {"native_send_object", "(III)Z",(void *)android_mtp_MtpDevice_send_object}, {"native_send_object_info", "(Landroid/mtp/MtpObjectInfo;)Landroid/mtp/MtpObjectInfo;", (void *)android_mtp_MtpDevice_send_object_info} }; Loading Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -18115,7 +18115,7 @@ package android.mtp { method public boolean importFile(int, java.lang.String); method public boolean importFile(int, android.os.ParcelFileDescriptor); method public boolean open(android.hardware.usb.UsbDeviceConnection); method public boolean sendObject(int, android.os.ParcelFileDescriptor); method public boolean sendObject(int, int, android.os.ParcelFileDescriptor); method public android.mtp.MtpObjectInfo sendObjectInfo(android.mtp.MtpObjectInfo); }
api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -19627,7 +19627,7 @@ package android.mtp { method public boolean importFile(int, java.lang.String); method public boolean importFile(int, android.os.ParcelFileDescriptor); method public boolean open(android.hardware.usb.UsbDeviceConnection); method public boolean sendObject(int, android.os.ParcelFileDescriptor); method public boolean sendObject(int, int, android.os.ParcelFileDescriptor); method public android.mtp.MtpObjectInfo sendObjectInfo(android.mtp.MtpObjectInfo); }
media/java/android/mtp/MtpDevice.java +4 −3 Original line number Diff line number Diff line Loading @@ -257,11 +257,12 @@ public final class MtpDevice { * on completion, and must be done by the caller. * * @param objectHandle handle of the target file * @param size size of the file in bytes * @param descriptor file descriptor to read the data from. * @return true if the file transfer succeeds */ public boolean sendObject(int objectHandle, ParcelFileDescriptor descriptor) { return native_send_object(objectHandle, descriptor.getFd()); public boolean sendObject(int objectHandle, int size, ParcelFileDescriptor descriptor) { return native_send_object(objectHandle, size, descriptor.getFd()); } /** Loading Loading @@ -294,6 +295,6 @@ public final class MtpDevice { private native long native_get_storage_id(int objectHandle); private native boolean native_import_file(int objectHandle, String destPath); private native boolean native_import_file(int objectHandle, int fd); private native boolean native_send_object(int objectHandle, int fd); private native boolean native_send_object(int objectHandle, int size, int fd); private native MtpObjectInfo native_send_object_info(MtpObjectInfo info); }
media/java/android/mtp/MtpObjectInfo.java +19 −19 Original line number Diff line number Diff line Loading @@ -273,25 +273,25 @@ public final class MtpObjectInfo { public Builder(MtpObjectInfo objectInfo) { mObjectInfo = new MtpObjectInfo(); mObjectInfo.mHandle = -1; mObjectInfo.mAssociationDesc = mObjectInfo.mAssociationDesc; mObjectInfo.mAssociationType = mObjectInfo.mAssociationType; mObjectInfo.mCompressedSize = mObjectInfo.mCompressedSize; mObjectInfo.mDateCreated = mObjectInfo.mDateCreated; mObjectInfo.mDateModified = mObjectInfo.mDateModified; mObjectInfo.mFormat = mObjectInfo.mFormat; mObjectInfo.mImagePixDepth = mObjectInfo.mImagePixDepth; mObjectInfo.mImagePixHeight = mObjectInfo.mImagePixHeight; mObjectInfo.mImagePixWidth = mObjectInfo.mImagePixWidth; mObjectInfo.mKeywords = mObjectInfo.mKeywords; mObjectInfo.mName = mObjectInfo.mName; mObjectInfo.mParent = mObjectInfo.mParent; mObjectInfo.mProtectionStatus = mObjectInfo.mProtectionStatus; mObjectInfo.mSequenceNumber = mObjectInfo.mSequenceNumber; mObjectInfo.mStorageId = mObjectInfo.mStorageId; mObjectInfo.mThumbCompressedSize = mObjectInfo.mThumbCompressedSize; mObjectInfo.mThumbFormat = mObjectInfo.mThumbFormat; mObjectInfo.mThumbPixHeight = mObjectInfo.mThumbPixHeight; mObjectInfo.mThumbPixWidth = mObjectInfo.mThumbPixWidth; mObjectInfo.mAssociationDesc = objectInfo.mAssociationDesc; mObjectInfo.mAssociationType = objectInfo.mAssociationType; mObjectInfo.mCompressedSize = objectInfo.mCompressedSize; mObjectInfo.mDateCreated = objectInfo.mDateCreated; mObjectInfo.mDateModified = objectInfo.mDateModified; mObjectInfo.mFormat = objectInfo.mFormat; mObjectInfo.mImagePixDepth = objectInfo.mImagePixDepth; mObjectInfo.mImagePixHeight = objectInfo.mImagePixHeight; mObjectInfo.mImagePixWidth = objectInfo.mImagePixWidth; mObjectInfo.mKeywords = objectInfo.mKeywords; mObjectInfo.mName = objectInfo.mName; mObjectInfo.mParent = objectInfo.mParent; mObjectInfo.mProtectionStatus = objectInfo.mProtectionStatus; mObjectInfo.mSequenceNumber = objectInfo.mSequenceNumber; mObjectInfo.mStorageId = objectInfo.mStorageId; mObjectInfo.mThumbCompressedSize = objectInfo.mThumbCompressedSize; mObjectInfo.mThumbFormat = objectInfo.mThumbFormat; mObjectInfo.mThumbPixHeight = objectInfo.mThumbPixHeight; mObjectInfo.mThumbPixWidth = objectInfo.mThumbPixWidth; } public Builder setAssociationDesc(int value) { Loading
media/jni/android_mtp_MtpDevice.cpp +3 −8 Original line number Diff line number Diff line Loading @@ -412,18 +412,13 @@ android_mtp_MtpDevice_import_file_to_fd(JNIEnv *env, jobject thiz, jint object_i } static jboolean android_mtp_MtpDevice_send_object(JNIEnv *env, jobject thiz, jint object_id, jint fd) android_mtp_MtpDevice_send_object(JNIEnv *env, jobject thiz, jint object_id, jint size, jint fd) { MtpDevice* device = get_device_from_object(env, thiz); if (!device) return JNI_FALSE; MtpObjectInfo* object_info = device->getObjectInfo(object_id); if (!object_info) return JNI_FALSE; bool result = device->sendObject(object_info, fd); delete object_info; return result; return device->sendObject(object_id, size, fd); } static jobject Loading Loading @@ -516,7 +511,7 @@ static JNINativeMethod gMethods[] = { {"native_import_file", "(ILjava/lang/String;)Z", (void *)android_mtp_MtpDevice_import_file}, {"native_import_file", "(II)Z",(void *)android_mtp_MtpDevice_import_file_to_fd}, {"native_send_object", "(II)Z",(void *)android_mtp_MtpDevice_send_object}, {"native_send_object", "(III)Z",(void *)android_mtp_MtpDevice_send_object}, {"native_send_object_info", "(Landroid/mtp/MtpObjectInfo;)Landroid/mtp/MtpObjectInfo;", (void *)android_mtp_MtpDevice_send_object_info} }; Loading