diff options
author | Dianne Hackborn <hackbod@google.com> | 2013-01-28 15:10:48 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2013-01-28 15:10:48 -0800 |
commit | fdb3f094ca967f8267f5bd30635063dc294d176f (patch) | |
tree | 9c03619e2485224b7d7f6104e270d78ea2aa32ea | |
parent | 93f770b59fa1bd0f2a5c18fcfaffd2a1fc54f585 (diff) | |
download | frameworks_base-fdb3f094ca967f8267f5bd30635063dc294d176f.zip frameworks_base-fdb3f094ca967f8267f5bd30635063dc294d176f.tar.gz frameworks_base-fdb3f094ca967f8267f5bd30635063dc294d176f.tar.bz2 |
Add GET_CONTENT protocol for allowing multiple selection.
Change-Id: I4c14d32112523d7ab603b2a4e374849dd1c3eff6
-rw-r--r-- | api/current.txt | 1 | ||||
-rw-r--r-- | core/java/android/content/Intent.java | 20 |
2 files changed, 19 insertions, 2 deletions
diff --git a/api/current.txt b/api/current.txt index fc60f94..a22eaf5 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5909,6 +5909,7 @@ package android.content { field public static final java.lang.String CATEGORY_UNIT_TEST = "android.intent.category.UNIT_TEST"; field public static final android.os.Parcelable.Creator CREATOR; field public static final java.lang.String EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT"; + field public static final java.lang.String EXTRA_ALLOW_MULTIPLE = "android.intent.extra.ALLOW_MULTIPLE"; field public static final deprecated java.lang.String EXTRA_ALLOW_REPLACE = "android.intent.extra.ALLOW_REPLACE"; field public static final java.lang.String EXTRA_ASSIST_CONTEXT = "android.intent.extra.ASSIST_CONTEXT"; field public static final java.lang.String EXTRA_ASSIST_PACKAGE = "android.intent.extra.ASSIST_PACKAGE"; diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index dc367dd..434946c 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -883,7 +883,7 @@ public class Intent implements Parcelable, Cloneable { * Activity Action: Allow the user to select a particular kind of data and * return it. This is different than {@link #ACTION_PICK} in that here we * just say what kind of data is desired, not a URI of existing data from - * which the user can pick. A ACTION_GET_CONTENT could allow the user to + * which the user can pick. An ACTION_GET_CONTENT could allow the user to * create the data as it runs (for example taking a picture or recording a * sound), let them browse over the web and download the desired data, * etc. @@ -917,12 +917,17 @@ public class Intent implements Parcelable, Cloneable { * from a remote server but not already on the local device (thus requiring * they be downloaded when opened). * <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> * Input: {@link #getType} is the desired MIME type to retrieve. Note * that no URI is supplied in the intent, as there are no constraints on * where the returned data originally comes from. You may also include the * {@link #CATEGORY_OPENABLE} if you can only accept data that can be * opened as a stream. You may use {@link #EXTRA_LOCAL_ONLY} to limit content - * selection to local data. + * selection to local data. You may use {@link #EXTRA_ALLOW_MULTIPLE} to + * allow the user to select multiple items. * <p> * Output: The URI of the item that was picked. This must be a content: * URI so that any receiver can access it. @@ -3045,6 +3050,17 @@ public class Intent implements Parcelable, Cloneable { "android.intent.extra.LOCAL_ONLY"; /** + * Used to indicate that a {@link #ACTION_GET_CONTENT} intent can allow the + * user to select and return multiple items. This is a boolean extra; the default + * is false. If true, an implementation of ACTION_GET_CONTENT is allowed to + * present the user with a UI where they can pick multiple items that are all + * returned to the caller. When this happens, they should be returned as + * the {@link #getClipData()} part of the result Intent. + */ + public static final String EXTRA_ALLOW_MULTIPLE = + "android.intent.extra.ALLOW_MULTIPLE"; + + /** * The userHandle carried with broadcast intents related to addition, removal and switching of users * - {@link #ACTION_USER_ADDED}, {@link #ACTION_USER_REMOVED} and {@link #ACTION_USER_SWITCHED}. * @hide |