summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2015-04-29 18:45:04 -0700
committerAdam Powell <adamp@google.com>2015-05-06 13:23:36 -0700
commit2ed547e55f820a9c705872d802b051d8ae9c906b (patch)
tree203cb52daddbd4c4dc4ac43eece1068938dcbbd2 /api
parent6223ec129b256526d8c30920271b2ee3960bcf1f (diff)
downloadframeworks_base-2ed547e55f820a9c705872d802b051d8ae9c906b.zip
frameworks_base-2ed547e55f820a9c705872d802b051d8ae9c906b.tar.gz
frameworks_base-2ed547e55f820a9c705872d802b051d8ae9c906b.tar.bz2
Add alternate intents and refinement callbacks to ChooserActivity
Allow a calling app to supply an array of additional Intents to the system ChooserActivity. The chooser will present a merged list of targets that can handle any of the Intents supplied, including both the standard EXTRA_INTENT as well as any of the intents supplied in EXTRA_ALTERNATE_INTENTS. These are treated as ordered; EXTRA_INTENT is considered the first/primary Intent and EXTRA_ALTERNATE_INTENTS are sorted most important first. Targets are queried for all supplied Intents. If the same component is returned for more than one Intent, the target is associated with the most important Intent that matched. This allows calling apps to supply several different payloads for an action depending on what the intended targets are able to support. For example, an app performing ACTION_SEND may supply image/jpeg data to compatible targets or a hosted web link to targets that only support text/plain. The user will have the opportunity to pick from a single merged list of choices using the best available payload, and will not be bothered with the implementation details of how the payload will be delivered to the recipient. If the calling app wishes to provide further disambiguation or refinement after the user makes a choice, for example to let the user choose which of the source intents to send from the primary or alternates, show a progress dialog as a full-resolution version of a photo is downloaded from the server before being sent along or while reticulating splines, the caller can supply an IntentSender to ACTION_CHOOSER including the extra EXTRA_REFINEMENT_INTENT_SENDER. This should be the IntentSender obtained from a PendingIntent pointing at an activity to launch to perform the refinement. The refinement activity should report that it is finished by obtaining the ResultReceiver from EXTRA_RESULT_RECEIVER. Available intents to send to the selected target will be contained in EXTRA_INTENT and EXTRA_ALTERNATE_INTENTS. To complete the refinement and send the result along to the chosen target, the refinement activity should select one of the supplied intents and send it to the ResultReceiver in a Bundle with the key EXTRA_INTENT and the result code RESULT_OK. To cancel the refinement, and let the user select another choice, send RESULT_CANCEL. While refinement activities cannot modify the filterEquals-affecting fields of the Intent they return, they may modify extras to provide additional or altered details to the final recipient. These extras will be filled into the Intent sent to the final target. Change-Id: I7ad4739eadd1a0e307675847ccf47ea948918a3a
Diffstat (limited to 'api')
-rw-r--r--api/current.txt3
-rw-r--r--api/system-current.txt3
2 files changed, 6 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt
index 375bee7..0ef4766 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -8282,6 +8282,7 @@ package android.content {
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_ALTERNATE_INTENTS = "android.intent.extra.ALTERNATE_INTENTS";
field public static final java.lang.String EXTRA_ASSIST_CONTEXT = "android.intent.extra.ASSIST_CONTEXT";
field public static final java.lang.String EXTRA_ASSIST_INPUT_HINT_KEYBOARD = "android.intent.extra.ASSIST_INPUT_HINT_KEYBOARD";
field public static final java.lang.String EXTRA_ASSIST_PACKAGE = "android.intent.extra.ASSIST_PACKAGE";
@@ -8293,6 +8294,7 @@ package android.content {
field public static final java.lang.String EXTRA_CHANGED_COMPONENT_NAME_LIST = "android.intent.extra.changed_component_name_list";
field public static final java.lang.String EXTRA_CHANGED_PACKAGE_LIST = "android.intent.extra.changed_package_list";
field public static final java.lang.String EXTRA_CHANGED_UID_LIST = "android.intent.extra.changed_uid_list";
+ field public static final java.lang.String EXTRA_CHOOSER_REFINEMENT_INTENT_SENDER = "android.intent.extra.CHOOSER_REFINEMENT_INTENT_SENDER";
field public static final java.lang.String EXTRA_CHOOSER_TARGETS = "android.intent.extra.CHOOSER_TARGETS";
field public static final java.lang.String EXTRA_CHOSEN_COMPONENT = "android.intent.extra.CHOSEN_COMPONENT";
field public static final java.lang.String EXTRA_CHOSEN_COMPONENT_INTENT_SENDER = "android.intent.extra.CHOSEN_COMPONENT_INTENT_SENDER";
@@ -8325,6 +8327,7 @@ package android.content {
field public static final java.lang.String EXTRA_RESTRICTIONS_BUNDLE = "android.intent.extra.restrictions_bundle";
field public static final java.lang.String EXTRA_RESTRICTIONS_INTENT = "android.intent.extra.restrictions_intent";
field public static final java.lang.String EXTRA_RESTRICTIONS_LIST = "android.intent.extra.restrictions_list";
+ field public static final java.lang.String EXTRA_RESULT_RECEIVER = "android.intent.extra.RESULT_RECEIVER";
field public static final java.lang.String EXTRA_RETURN_RESULT = "android.intent.extra.RETURN_RESULT";
field public static final java.lang.String EXTRA_SHORTCUT_ICON = "android.intent.extra.shortcut.ICON";
field public static final java.lang.String EXTRA_SHORTCUT_ICON_RESOURCE = "android.intent.extra.shortcut.ICON_RESOURCE";
diff --git a/api/system-current.txt b/api/system-current.txt
index 63ba05f..3aa6ca0 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -8508,6 +8508,7 @@ package android.content {
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_ALTERNATE_INTENTS = "android.intent.extra.ALTERNATE_INTENTS";
field public static final java.lang.String EXTRA_ASSIST_CONTEXT = "android.intent.extra.ASSIST_CONTEXT";
field public static final java.lang.String EXTRA_ASSIST_INPUT_HINT_KEYBOARD = "android.intent.extra.ASSIST_INPUT_HINT_KEYBOARD";
field public static final java.lang.String EXTRA_ASSIST_PACKAGE = "android.intent.extra.ASSIST_PACKAGE";
@@ -8519,6 +8520,7 @@ package android.content {
field public static final java.lang.String EXTRA_CHANGED_COMPONENT_NAME_LIST = "android.intent.extra.changed_component_name_list";
field public static final java.lang.String EXTRA_CHANGED_PACKAGE_LIST = "android.intent.extra.changed_package_list";
field public static final java.lang.String EXTRA_CHANGED_UID_LIST = "android.intent.extra.changed_uid_list";
+ field public static final java.lang.String EXTRA_CHOOSER_REFINEMENT_INTENT_SENDER = "android.intent.extra.CHOOSER_REFINEMENT_INTENT_SENDER";
field public static final java.lang.String EXTRA_CHOOSER_TARGETS = "android.intent.extra.CHOOSER_TARGETS";
field public static final java.lang.String EXTRA_CHOSEN_COMPONENT = "android.intent.extra.CHOSEN_COMPONENT";
field public static final java.lang.String EXTRA_CHOSEN_COMPONENT_INTENT_SENDER = "android.intent.extra.CHOSEN_COMPONENT_INTENT_SENDER";
@@ -8554,6 +8556,7 @@ package android.content {
field public static final java.lang.String EXTRA_RESTRICTIONS_BUNDLE = "android.intent.extra.restrictions_bundle";
field public static final java.lang.String EXTRA_RESTRICTIONS_INTENT = "android.intent.extra.restrictions_intent";
field public static final java.lang.String EXTRA_RESTRICTIONS_LIST = "android.intent.extra.restrictions_list";
+ field public static final java.lang.String EXTRA_RESULT_RECEIVER = "android.intent.extra.RESULT_RECEIVER";
field public static final java.lang.String EXTRA_RETURN_RESULT = "android.intent.extra.RETURN_RESULT";
field public static final java.lang.String EXTRA_SHORTCUT_ICON = "android.intent.extra.shortcut.ICON";
field public static final java.lang.String EXTRA_SHORTCUT_ICON_RESOURCE = "android.intent.extra.shortcut.ICON_RESOURCE";