List of usage examples for android.provider DocumentsContract buildSearchDocumentsUri
public static Uri buildSearchDocumentsUri(String authority, String rootId, String query)
From source file:org.alfresco.mobile.android.application.providers.storage.StorageAccessDocumentsProvider.java
@Override public Cursor querySearchDocuments(String rootId, final String query, String[] projection) throws FileNotFoundException { final DocumentFolderCursor documentFolderCursor = new DocumentFolderCursor( resolveDocumentProjection(projection)); Uri uri = DocumentsContract.buildSearchDocumentsUri(mAuthority, rootId, query); final EncodedQueryUri cUri = new EncodedQueryUri(rootId); Boolean active = mLoadingUris.get(uri); if (active != null) { for (Entry<String, Node> nodeEntry : nodesIndex.entrySet()) { addNodeRow(documentFolderCursor, nodeEntry.getValue()); }/*from w w w.j a va2 s .c o m*/ if (!active) { // loading request is finished and refreshed mLoadingUris.remove(uri); } } if (active == null) { new StorageProviderAsyncTask(uri, documentFolderCursor, true) { @Override protected Void doInBackground(Void... params) { checkSession(cUri); List<Node> nodes = session.getServiceRegistry().getSearchService().keywordSearch(query, new KeywordSearchOptions()); for (Node node : nodes) { nodesIndex.put(NodeRefUtils.getVersionIdentifier(node.getIdentifier()), node); } return null; } }.execute(); } return documentFolderCursor; }