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
Loading
Please register or sign in to comment