@Override
    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
                        String sortOrder) {
        // ContentProvider has already checked granted permissions
        final File file = mStrategy.getFileForUri(uri);

        if (projection == null) {
            projection = COLUMNS;
        }

        String[] cols = new String[projection.length];
        Object[] values = new Object[projection.length];
        int i = 0;
        for (String col : projection) {
            if (OpenableColumns.DISPLAY_NAME.equals(col)) {
                cols[i] = OpenableColumns.DISPLAY_NAME;
                values[i++] = file.getName();
            } else if (OpenableColumns.SIZE.equals(col)) {
                cols[i] = OpenableColumns.SIZE;
                values[i++] = file.length();
            }
        }

        cols = copyOf(cols, i);
        values = copyOf(values, i);

        final MatrixCursor cursor = new MatrixCursor(cols, 1);
        cursor.addRow(values);
        return cursor;
    }
Use a content URI returned by
{@link #getUriForFile(Context, String, File) getUriForFile()} to get information about a file
managed by the FileProvider.
FileProvider reports the column names defined in {@link OpenableColumns}:
<ul>
<li>{@link OpenableColumns#DISPLAY_NAME}</li>
<li>{@link OpenableColumns#SIZE}</li>
</ul>
For more information, see
{@link ContentProvider#query(Uri, String[], String, String[], String)
ContentProvider.query()}.

@param uri           A content URI returned by {@link #getUriForFile}.
@param projection    The list of columns to put into the {@link Cursor}. If null all columns are
                     included.
@param selection     Selection criteria to apply. If null then all data that matches the content
                     URI is returned.
@param selectionArgs An array of {@link String}, containing arguments to bind to
                     the <i>selection</i> parameter. The <i>query</i> method scans <i>selection</i> from left to
                     right and iterates through <i>selectionArgs</i>, replacing the current "?" character in
                     <i>selection</i> with the value at the current position in <i>selectionArgs</i>. The
                     values are bound to <i>selection</i> as {@link String} values.
@param sortOrder     A {@link String} containing the column name(s) on which to sort
                     the resulting {@link Cursor}.
@return A {@link Cursor} containing the results of the query.
replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/provider/FileProvider.java