If the remote MTP device is backed by typical file system, the file name
is unique among files in a directory. However, MTP protocol itself does
not guarantee the uniqueness of name so we cannot use fullpath as ID.
Instead of fullpath, we use artifical ID generated by MtpDatabase
itself. So we don't need to store fullpath in the database.
BUG=25162822
Change-Id: I06598ce631a3221ed72e11734dbdaefef4c6349c
The class stores document information and will be used to remap object
handle with document ID when the process resumes.
BUG=25162822
Change-Id: Ic1a2f60ae0ee90b6c2b77a89a578cef1e0e917f2
Start to use common MeidaFile helper class that can convert major format
code into mime type.
BUG=25096009
Change-Id: I8379cc6f11945c8e2215d36492367e73377fdc26
Uploading was breaking as SendObject request was not being sent directly
after SendObjectInfo which is assumed by the MTP stack in Android.
Change-Id: I36b94f56682e79dec38add9be5f70f55d07e22e7
When testing a real MTP device, we cannot obtain test results by using the USB
port because the USB port is occupied by the MTP devcie. The CL adds an activity
to test package that shows test results.
BUG=23536467
Change-Id: I0e53c2de122cb3afd52f22bedd93ece53aaeb525
This patch does not yet allow to upload files, but uploading (creating)
directories already works.
Bug: 22545670
Change-Id: If4d5a53aa26f791475bb1a783e0ac9540d6760c1
The CL introduce DocumentLoader class that has a responsibility for loading
documents on background thread. When the provider is requested documents and the
result is not cached, it returns the cursor containing the first 10 items with
extra loading flag. Then it loads the rest of documents into cache on background
thread and notifies update regularly.
BUG=23067619
Change-Id: I7ac9d919bc3ffee1960ae3e8e7272a792a982ea8
* Change separator for ID from ':' to '_' so that the ID can be used as a file
name in FAT.
* Implements equals and hashCode methods.
BUG=20274999
Change-Id: Ibb83151f7d6bdb0c993622dddeb89723aecfa264
Now default configuration of proguard can handle internal VisibleForTesting
annotation. We don't need to have local configuration.
BUG=20274999
Change-Id: Ib21e07336e48dda71d0d2644ddd86422414f7524
To show the application chooser for the UsbManager.ACTION_USB_DEVICE_ATTACHED
intent, the intent should be received by activity. The activity has NoDisplay
theme and immediately terminate after routing intent to MtpDocumentsService.
BUG=20274999
Change-Id: I2080ea433b1657dd68640681664adbf92d1d30e9
These methods will be called in the following CL from the service that handles
USB attach and detach intent.
BUG=20274999
Change-Id: I7b3c658afc5750d6a2713c07f40c59b26dcd1460