Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62744121 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add a more flexible queryRecentDocuments"

parents cd480214 6a4a8f60
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -36378,6 +36378,7 @@ package android.provider {
    method public android.database.Cursor queryChildDocuments(java.lang.String, java.lang.String[], android.os.Bundle) throws java.io.FileNotFoundException;
    method public abstract android.database.Cursor queryDocument(java.lang.String, java.lang.String[]) throws java.io.FileNotFoundException;
    method public android.database.Cursor queryRecentDocuments(java.lang.String, java.lang.String[]) throws java.io.FileNotFoundException;
    method public android.database.Cursor queryRecentDocuments(java.lang.String, java.lang.String[], android.os.Bundle, android.os.CancellationSignal) throws java.io.FileNotFoundException;
    method public abstract android.database.Cursor queryRoots(java.lang.String[]) throws java.io.FileNotFoundException;
    method public android.database.Cursor querySearchDocuments(java.lang.String, java.lang.String, java.lang.String[]) throws java.io.FileNotFoundException;
    method public void removeDocument(java.lang.String, java.lang.String) throws java.io.FileNotFoundException;
+38 −2
Original line number Diff line number Diff line
@@ -460,6 +460,41 @@ public abstract class DocumentsProvider extends ContentProvider {
        throw new UnsupportedOperationException("Recent not supported");
    }

    /**
     * Return recently modified documents under the requested root. This will
     * only be called for roots that advertise
     * {@link Root#FLAG_SUPPORTS_RECENTS}. The returned documents should be
     * sorted by {@link Document#COLUMN_LAST_MODIFIED} in descending order of
     * the most recently modified documents.
     * <p>
     * If this method is overriden by the concrete DocumentsProvider and
     * QUERY_ARGS_LIMIT is specified with a nonnegative int under queryArgs, the
     * result will be limited by that number and QUERY_ARG_LIMIT will be
     * specified under EXTRA_HONORED_ARGS. Otherwise, a default 64 limit will
     * be used and no QUERY_ARG* will be specified under EXTRA_HONORED_ARGS.
     * <p>
     * Recent documents do not support change notifications.
     *
     * @param projection list of {@link Document} columns to put into the
     *            cursor. If {@code null} all supported columns should be
     *            included.
     * @param queryArgs the extra query arguments.
     * @param signal used by the caller to signal if the request should be
     *            cancelled. May be null.
     * @see DocumentsContract#EXTRA_LOADING
     */
    @SuppressWarnings("unused")
    public Cursor queryRecentDocuments(
            String rootId, String[] projection, @Nullable Bundle queryArgs,
            @Nullable CancellationSignal signal)
            throws FileNotFoundException {
        Cursor c = queryRecentDocuments(rootId, projection);
        Bundle extras = new Bundle();
        c.setExtras(extras);
        extras.putStringArray(ContentResolver.EXTRA_HONORED_ARGS, new String[0]);
        return c;
    }

    /**
     * Return metadata for the single requested document. You should avoid
     * making network requests to keep this request fast.
@@ -774,7 +809,7 @@ public abstract class DocumentsProvider extends ContentProvider {
     * Implementation is provided by the parent class. Cannot be overriden.
     *
     * @see #queryRoots(String[])
     * @see #queryRecentDocuments(String, String[])
     * @see #queryRecentDocuments(String, String[], Bundle, CancellationSignal)
     * @see #queryDocument(String, String[])
     * @see #queryChildDocuments(String, String[], String)
     * @see #querySearchDocuments(String, String, String[])
@@ -787,7 +822,8 @@ public abstract class DocumentsProvider extends ContentProvider {
                case MATCH_ROOTS:
                    return queryRoots(projection);
                case MATCH_RECENT:
                    return queryRecentDocuments(getRootId(uri), projection);
                    return queryRecentDocuments(
                            getRootId(uri), projection, queryArgs, cancellationSignal);
                case MATCH_SEARCH:
                    return querySearchDocuments(
                            getRootId(uri), getSearchDocumentsQuery(uri), projection);