Extend DocumentsContract search to accept mime types

1. Add the key of query arguments and match method
   in DocumentsContract.
2. Implement new querySearchDocuments method in
   DocumentsProvider, ExternalStoragProvider and
   FileSystemProvider.

Bug: 111786939
Test: Manual Test
Change-Id: I04e9f2be971f10ac1e9584a3486c948aaddea0a4
This commit is contained in:
Ivan Chiang
2018-10-15 15:23:02 +08:00
parent 2823d3abdd
commit a972d0449a
5 changed files with 398 additions and 43 deletions

View File

@@ -541,14 +541,14 @@ public class ExternalStorageProvider extends FileSystemProvider {
}
@Override
public Cursor querySearchDocuments(String rootId, String query, String[] projection)
public Cursor querySearchDocuments(String rootId, String[] projection, Bundle queryArgs)
throws FileNotFoundException {
final File parent;
synchronized (mRootsLock) {
parent = mRoots.get(rootId).path;
}
return querySearchDocuments(parent, query, projection, Collections.emptySet());
return querySearchDocuments(parent, projection, Collections.emptySet(), queryArgs);
}
@Override