summaryrefslogtreecommitdiff
path: root/core/java/android/content/Intent.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-04-19 14:05:03 -0700
committerJeff Sharkey <jsharkey@android.com>2013-05-01 17:21:06 -0700
commit9ecfee03fa188aebfbd9778b4e020323903495ee (patch)
treeffc67525888fb5658f6e504c01b7bda6273621db /core/java/android/content/Intent.java
parent85c5f084e516994adcf08a6a244a2d1f0fcfe1d3 (diff)
Start fleshing out new storage APIs.
Introduces new DocumentsContract which storage backends must implement. Backends surface a simple directory-like organizational structure that enables a document to appear at multiple locations in that hierarchy. Querying a document or the contents of a directory will return a Cursor populated with DocumentColumns, which includes simple metadata. Adds new OPEN_DOC and CREATE_DOC Intents, and permission to protect storage backends. Change-Id: Ib4984bc980182b2cedbe552908e5be94604ef085
Diffstat (limited to 'core/java/android/content/Intent.java')
-rw-r--r--core/java/android/content/Intent.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 5fa1a6cd52db..621bcee942bf 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -2591,6 +2591,46 @@ public class Intent implements Parcelable, Cloneable {
*/
public static final String ACTION_GLOBAL_BUTTON = "android.intent.action.GLOBAL_BUTTON";
+ /**
+ * Activity Action: Allow the user to select and open one or more existing
+ * documents. Both read and write access to the documents will be granted
+ * until explicitly revoked by the user.
+ * <p>
+ * Callers can restrict selection to a specific kind of data, such as
+ * photos, by setting one or more MIME types in {@link #EXTRA_MIME_TYPES}.
+ * <p>
+ * If the caller can handle multiple returned items (the user performing
+ * multiple selection), then it can specify {@link #EXTRA_ALLOW_MULTIPLE} to
+ * indicate this.
+ * <p>
+ * All returned URIs can be opened as a stream with
+ * {@link ContentResolver#openInputStream(Uri)}.
+ * <p>
+ * Output: The URI of the item that was picked. This must be a content: URI
+ * so that any receiver can access it.
+ */
+ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+ public static final String ACTION_OPEN_DOCUMENT = "android.intent.action.OPEN_DOCUMENT";
+
+ /**
+ * Activity Action: Allow the user to create a new document. Both read and
+ * write access to the document will be granted until explicitly revoked by
+ * the user.
+ * <p>
+ * Callers can provide a hint document name by setting {@link #EXTRA_TITLE},
+ * but the user may change this value before creating the file. Callers can
+ * optionally hint at the MIME type being created by setting
+ * {@link #setType(String)}.
+ * <p>
+ * All returned URIs can be opened as a stream with
+ * {@link ContentResolver#openOutputStream(Uri)}.
+ * <p>
+ * Output: The URI of the item that was created. This must be a content: URI
+ * so that any receiver can access it.
+ */
+ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+ public static final String ACTION_CREATE_DOCUMENT = "android.intent.action.CREATE_DOCUMENT";
+
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// Standard intent categories (see addCategory()).
@@ -3194,6 +3234,14 @@ public class Intent implements Parcelable, Cloneable {
public static final String EXTRA_RESTRICTIONS_INTENT =
"android.intent.extra.restrictions_intent";
+ /**
+ * Extra used to communicate set of acceptable MIME types for
+ * {@link #ACTION_GET_CONTENT} or {@link #ACTION_OPEN_DOC}. The type of the
+ * extra is <code>ArrayList&lt;String&gt;</code>.
+ * @hide
+ */
+ public static final String EXTRA_MIME_TYPES = "android.intent.extra.MIME_TYPES";
+
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// Intent flags (see mFlags variable).