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

Commit a8057a9d authored by Tomasz Mikolajewski's avatar Tomasz Mikolajewski
Browse files

Add first-class support for virtual files in SAF.

Bug: 20820363
Change-Id: Ic509a6003a99997126f129a836fdd8c0e843108f
parent f58bc8d1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -26280,6 +26280,7 @@ package android.provider {
    field public static final int FLAG_SUPPORTS_THUMBNAIL = 1; // 0x1
    field public static final int FLAG_SUPPORTS_TYPED_DOCUMENT = 512; // 0x200
    field public static final int FLAG_SUPPORTS_WRITE = 2; // 0x2
    field public static final int FLAG_VIRTUAL_DOCUMENT = 1024; // 0x400
    field public static final java.lang.String MIME_TYPE_DIR = "vnd.android.document/directory";
  }
+1 −0
Original line number Diff line number Diff line
@@ -28293,6 +28293,7 @@ package android.provider {
    field public static final int FLAG_SUPPORTS_THUMBNAIL = 1; // 0x1
    field public static final int FLAG_SUPPORTS_TYPED_DOCUMENT = 512; // 0x200
    field public static final int FLAG_SUPPORTS_WRITE = 2; // 0x2
    field public static final int FLAG_VIRTUAL_DOCUMENT = 1024; // 0x400
    field public static final java.lang.String MIME_TYPE_DIR = "vnd.android.document/directory";
  }
+4 −4
Original line number Diff line number Diff line
@@ -2956,8 +2956,8 @@ public class Intent implements Parcelable, Cloneable {
     * multiple selection), then you can specify {@link #EXTRA_ALLOW_MULTIPLE}
     * to indicate this.
     * <p>
     * Callers must include {@link #CATEGORY_OPENABLE} in the Intent so that
     * returned URIs can be opened with
     * Callers must include {@link #CATEGORY_OPENABLE} in the Intent to obtain
     * URIs that can be opened with
     * {@link ContentResolver#openFileDescriptor(Uri, String)}.
     * <p>
     * Output: The URI of the item that was picked, returned in
@@ -2992,8 +2992,8 @@ public class Intent implements Parcelable, Cloneable {
     * Callers can provide an initial display name through {@link #EXTRA_TITLE},
     * but the user may change this value before creating the file.
     * <p>
     * Callers must include {@link #CATEGORY_OPENABLE} in the Intent so that
     * returned URIs can be opened with
     * Callers must include {@link #CATEGORY_OPENABLE} in the Intent to obtain
     * URIs that can be opened with
     * {@link ContentResolver#openFileDescriptor(Uri, String)}.
     * <p>
     * Output: The URI of the item that was created. This must be a
+12 −0
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@ public final class DocumentsContract {
         * @see #FLAG_SUPPORTS_TYPED_DOCUMENT
         * @see #FLAG_DIR_PREFERS_GRID
         * @see #FLAG_DIR_PREFERS_LAST_MODIFIED
         * @see #FLAG_VIRTUAL_DOCUMENT
         */
        public static final String COLUMN_FLAGS = "flags";

@@ -355,6 +356,17 @@ public final class DocumentsContract {
         */
        public static final int FLAG_SUPPORTS_TYPED_DOCUMENT = 1 << 9;

        /**
         * Flag indicating that a document is virtual, and doesn't have byte
         * representation in the MIME type specified as {@link #COLUMN_MIME_TYPE}.
         *
         * @see #COLUMN_FLAGS
         * @see #COLUMN_MIME_TYPE
         * @see DocumentsProvider#openTypedDocument(String, String, Bundle,
         *      android.os.CancellationSignal)
         */
        public static final int FLAG_VIRTUAL_DOCUMENT = 1 << 10;

        /**
         * Flag indicating that document titles should be hidden when viewing
         * this directory in a larger format grid. For example, a directory
+5 −0
Original line number Diff line number Diff line
@@ -172,6 +172,11 @@ public class DocumentsActivity extends BaseActivity {
                    Intent.EXTRA_ALLOW_MULTIPLE, false);
        }

        if (state.action == ACTION_OPEN || state.action == ACTION_GET_CONTENT
                || state.action == ACTION_CREATE) {
            state.openableOnly = intent.hasCategory(Intent.CATEGORY_OPENABLE);
        }

        if (state.action == ACTION_PICK_COPY_DESTINATION) {
            state.directoryCopy = intent.getBooleanExtra(
                    Shared.EXTRA_DIRECTORY_COPY, false);
Loading