History log of /frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f4e7fa80384ac72d0228ca5de6e949a9162cefbf 28-Mar-2016 Daichi Hirono <hirono@google.com> Use AppFuse to write document.

Previously MtpDocumentsProvider used pipes to transfer bytes from an
application to the provider when writing a document. The problem was
application could not ensure that the last chunk of bytes was
successfully written to MTP device, since pipes had been already closed
when the provider transferred bytes to MTP device. Though the provider
encountered an error, the provider could not report the error to an
application.

The CL switches the method to transfer bytes from pipes to AppFuse. Now
application can flush() bytes on the file descriptor, and flush will not
complete until the provider completes writing bytes to MTP device.

Fixed: 23093747
Change-Id: I4e28f8cbf19d6c97e591943349a7535241d768f7
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
64111e08d905525c7f4fe27e69953eb71bd62511 24-Mar-2016 Daichi Hirono <hirono@google.com> Get object size that is more than 4GB.

MtpObjectInfo contains object size as 32-bit integer and the provider
needs to invoke MtpDevice#getObjectSizeLong hidden API to get 64-bit
object size.

The CL switches to use MtpDevice#getObjectSizeLong hidden API if
MtpObjectInfo#getCompressedSize() returns 0xffffffffL, which means the
object size is more than 4GB.

BUG=27805369

Change-Id: I87ea02c09aa784246cf016def309d1f39ed20e90
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
acb0e27bb33e373f1c42d6e2ef9344169cae96f0 14-Mar-2016 Daichi Hirono <hirono@google.com> Regard timeout as an error in the MtpDocumentsProvider test.

Previously if DocumentsProvider found timeout when terminatnig
RootScanner's background thread, it just output it in error log. Thus
the timeout is not regarded as an error in MtpDocumentsProviderTest, and
it makes flaky PipeManagerTest which runs just after
MtpDocumentsProviderTest.

The CL

* lets MtpDocumentsProvider throw TimeoutException for timeout.
* removes redundant resumeRootScanner calls to avoid timeout of
RootScanner#pause.

Also the CL did cleanup the logic that pauses RootScanner when we don't
find any devices. Previously the logic was in
MtpDocumentsProvider#closeInternal but it is not efficient because we
invokes RootScanner#resume just after
MtpDocumentsProvider#closeInternal. Now the CL moves the logic to
RootScanner so that it can pause itself automatically.

BUG=27638500

Change-Id: Ic11bca67c099cbb0f46679db2f035988045d67d6
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
24ab92a5f7492f116ae82f354f406de60a0d912c 04-Mar-2016 Daichi Hirono <hirono@google.com> Ensure to complete background thread of PipeManager.

BUG=27488803

Change-Id: Ib540ab42f6263e1aea4c1bb184a4f88aa1454a14
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
61ba923ca0cb5c928a16729d0aa67b6bf4b2f027 25-Feb-2016 Daichi Hirono <hirono@google.com> Set document flag by referring MTP supported operations.

BUG=26147375

Change-Id: I6c4244f1f1153c1bbbf21ea9d608dc1a92ca70cd
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
f578fa275a535016f5322c88ad7a92e517d04a12 19-Feb-2016 Daichi Hirono <hirono@google.com> Update object info when writing a file.

The MTP spec does not offer a way to update bytes of exisitng files, so
our provider implementation creates a new file with new bytes and
removes old one.

Previously the new file uses new document ID and the exising document ID
is expired. Also the provider does not update the metadata
database. Thus users see the old flie in DocumentsUI but actually the
files is not accessible.

The CL updates the database with exisitng document ID, so that we can
access the new file with exisiting document ID.

BUG=26549400

Change-Id: I629b707a2e662b34625e8b28857ef818d8933996
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
6a5ea7eae8a70bced97ceef051c965c27cb642ca 02-Feb-2016 Daichi Hirono <hirono@google.com> Move logic to skip single storage.

The tree structure of MTP model looks like /device/storage/objects. But
almost all MTP device has only single storage, so it's redundant to show
a single storage as a child of device in UI.

MtpDocumentsProvider has a special logic to skip single storage, and
shows storage's object as a children of device in such case. Previously
the logic was applied when MtpDocumentsProvider returned a root
list. The provider returns a storage as a Documents.Root, instead of
device if the device has only one storage.

However the number of root cannot be obtain for closed device. Thus the
previous logic did not work for closed devices that have a single
storage. The CL moves the logic from queryRoot to
queryChildDocuments. Now MtpDocumentsProvider always returns a device as
root, then it returns storage's objects as the device's children, where
we has already opened the device.

BUG=26481574

Change-Id: I25af0fc220410e321a378d67f226798ec4bba19c
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
9e8a4fa78f5b9e3964dca84ad4047210d35c4013 19-Nov-2015 Daichi Hirono <hirono@google.com> Change ID format of MtpDocumentsProvider.

BUG=25704562

Change-Id: I5d9fc167512eee06964650e07206e226173611b2
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
4604b74603ea951c0f0d0fc2d9b6bd46ae54e245 11-Nov-2015 Daichi Hirono <hirono@google.com> Prepare for adding MtpDocumentsProvider tests to APCT.

BUG=25093356

Change-Id: I0c194e6bf3abeb632171e9be49471b9d94a0cb4c
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
bb430fa930fa0d0700e46e7b4881de2a252223dd 25-Aug-2015 Tomasz Mikolajewski <mtomasz@google.com> Remove MtpDocument.

Change-Id: Ie4b0e55f6ff2c7b323cf767a5ed3d3c61c12734d
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
3edb420137b101ac5f5829d8b6e983f4950bbc4e 31-Aug-2015 Tomasz Mikolajewski <mtomasz@google.com> Fix remaining renames in MtpDocumentsProvider tests.

Change-Id: I7093654c35faa750c12f75da57ddfa2828c474b0
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
c68b9df81ecbd2ce14deb3e6ac1dd0d28cf89de2 31-Aug-2015 Daichi Hirono <hirono@google.com> Merge "Fix member naming style in PipeManagerTest."
84dfb05407fc6e36c662e2dd6999e1919db4b969 30-Aug-2015 Daichi Hirono <hirono@google.com> Fix member naming style in PipeManagerTest.

BUG=None

Change-Id: I962a37667f110ee17e62e24517db6a85aa227b9f
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
b80a3cfd05fc7492dd59b7f8d4337eb5e29088c2 24-Aug-2015 Tomasz Mikolajewski <mtomasz@google.com> Add support for uploading files via MTP.

Change-Id: Id1811ab70cb28be471e0a99999e9ad5380deac49
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
3faa43a4a6f270e2e1e2ec55b77508084af16757 05-Aug-2015 Daichi Hirono <hirono@google.com> Implement MtpDocumentsProvider#openDocumentThumbnail.

BUG=20274999
Change-Id: I4ee43d94d92735e07786dfe557eaca69e8bff6c3
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
52652ac7a5f479f7f5e24f78778203bd88c0c4f4 05-Aug-2015 Tomasz Mikolajewski <mtomasz@google.com> Make reading files streamed in MtpDocumentsProvider.

Change-Id: If5ca4fc71cf27a2eccb46865421235790623985a
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java
8ba419119d50a031160cab54bef6899bd0051ea9 30-Jul-2015 Daichi Hirono <hirono@google.com> Implement MtpDocuments#openDocument.

BUG=20274999

Change-Id: Iebcee84cb47ac521412b15f91903922953cbd3a8
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/PipeManagerTest.java