From 099f95181d5fdf905d4a77c9a364c458030064b1 Mon Sep 17 00:00:00 2001 From: Tomasz Mikolajewski Date: Fri, 9 Dec 2016 10:19:46 +0900 Subject: [PATCH] Update API documentation about virtual files. To say that virtual files must have at least one streamable type. Test: None Bug: 33463773 Change-Id: I9094686cb95ee0af1c01b2bf88550cd3bbfe572d --- core/java/android/provider/DocumentsContract.java | 3 +++ core/java/android/provider/DocumentsProvider.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/core/java/android/provider/DocumentsContract.java b/core/java/android/provider/DocumentsContract.java index 383cae19e4797..e462ae91f35f6 100644 --- a/core/java/android/provider/DocumentsContract.java +++ b/core/java/android/provider/DocumentsContract.java @@ -376,6 +376,9 @@ public final class DocumentsContract { * Flag indicating that a document is virtual, and doesn't have byte * representation in the MIME type specified as {@link #COLUMN_MIME_TYPE}. * + *

Virtual documents must have at least one alternative streamable + * format via {@link DocumentsProvider#openTypedDocument} + * * @see #COLUMN_FLAGS * @see #COLUMN_MIME_TYPE * @see DocumentsProvider#openTypedDocument(String, String, Bundle, diff --git a/core/java/android/provider/DocumentsProvider.java b/core/java/android/provider/DocumentsProvider.java index 96c2556428b8a..584f5fe494e16 100644 --- a/core/java/android/provider/DocumentsProvider.java +++ b/core/java/android/provider/DocumentsProvider.java @@ -575,6 +575,8 @@ public abstract class DocumentsProvider extends ContentProvider { *

* A provider may perform a conversion if the documents's MIME type is not * matching the specified MIME type filter. + *

+ * Virtual documents must have at least one streamable format. * * @param documentId the document to return. * @param mimeTypeFilter the MIME type filter for the requested format. May @@ -1044,6 +1046,8 @@ public abstract class DocumentsProvider extends ContentProvider { * {@link #queryDocument(String, String[])} as long as it matches the filter and the document * does not have the {@link Document#FLAG_VIRTUAL_DOCUMENT} flag set. * + *

Virtual documents must have at least one streamable format. + * * @see #getStreamTypes(Uri, String) * @see #openTypedDocument(String, String, Bundle, CancellationSignal) */