Adding an Extra field for Intents so chooser show up even if one app.
By design, ChooserActivity (the activity that shows up when there's an
intent sent that can be handled by multiple apps) always default to not
show if there's only one app available to choose from. This adds the
extra in Intent such that if passed in, the parent activity can choose
to override the behavior and force show the chooser even if there's only
one app. Default is still skipping the chooser.
Bug: 31830662
Change-Id: I17d676e77094cded4af99c7433f511e8c6c58164
(cherry picked from commit 2c5adbdf1942898baa97a3c8a7976fc7c0627902)
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index f487d08..e031275 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -4196,6 +4196,16 @@
"android.intent.extra.MEDIA_RESOURCE_TYPE";
/**
+ * Used as a boolean extra field in {@link #ACTION_CHOOSER} intents to specify
+ * whether to show the chooser or not when there is only one application available
+ * to choose from.
+ *
+ * @hide
+ */
+ public static final String EXTRA_AUTO_LAUNCH_SINGLE_CHOICE =
+ "android.intent.extra.AUTO_LAUNCH_SINGLE_CHOICE";
+
+ /**
* Used as an int value for {@link #EXTRA_MEDIA_RESOURCE_TYPE}
* to represent that a video codec is allowed to use.
*