Merge "Add API for sharesheet text album hint" into main
diff --git a/core/api/current.txt b/core/api/current.txt
index 10b6081..7dedbd8 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -11254,6 +11254,7 @@
field public static final String CATEGORY_UNIT_TEST = "android.intent.category.UNIT_TEST";
field public static final String CATEGORY_VOICE = "android.intent.category.VOICE";
field public static final String CATEGORY_VR_HOME = "android.intent.category.VR_HOME";
+ field @FlaggedApi("android.service.chooser.chooser_album_text") public static final int CHOOSER_CONTENT_TYPE_ALBUM = 1; // 0x1
field @NonNull public static final android.os.Parcelable.Creator<android.content.Intent> CREATOR;
field public static final String EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT";
field public static final String EXTRA_ALLOW_MULTIPLE = "android.intent.extra.ALLOW_MULTIPLE";
@@ -11275,6 +11276,7 @@
field public static final String EXTRA_CHANGED_COMPONENT_NAME_LIST = "android.intent.extra.changed_component_name_list";
field public static final String EXTRA_CHANGED_PACKAGE_LIST = "android.intent.extra.changed_package_list";
field public static final String EXTRA_CHANGED_UID_LIST = "android.intent.extra.changed_uid_list";
+ field @FlaggedApi("android.service.chooser.chooser_album_text") public static final String EXTRA_CHOOSER_CONTENT_TYPE_HINT = "android.intent.extra.CHOOSER_CONTENT_TYPE_HINT";
field public static final String EXTRA_CHOOSER_CUSTOM_ACTIONS = "android.intent.extra.CHOOSER_CUSTOM_ACTIONS";
field public static final String EXTRA_CHOOSER_MODIFY_SHARE_ACTION = "android.intent.extra.CHOOSER_MODIFY_SHARE_ACTION";
field public static final String EXTRA_CHOOSER_REFINEMENT_INTENT_SENDER = "android.intent.extra.CHOOSER_REFINEMENT_INTENT_SENDER";
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index d5eee63f..08871d4 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -6034,6 +6034,36 @@
"android.intent.extra.CHOOSER_MODIFY_SHARE_ACTION";
/**
+ * Optional integer extra to be used with {@link #ACTION_CHOOSER} to describe conteng being
+ * shared.
+ * <p>
+ * If provided, sharesheets may customize their UI presentation to include a more precise
+ * description of the content being shared.
+ *
+ * @see #CHOOSER_CONTENT_TYPE_ALBUM
+ * @see #createChooser(Intent, CharSequence)
+ */
+ @FlaggedApi(android.service.chooser.Flags.FLAG_CHOOSER_ALBUM_TEXT)
+ public static final String EXTRA_CHOOSER_CONTENT_TYPE_HINT =
+ "android.intent.extra.CHOOSER_CONTENT_TYPE_HINT";
+
+ /** @hide */
+ @IntDef(prefix = {"CHOOSER_CONTENT_TYPE_"}, value = {
+ CHOOSER_CONTENT_TYPE_ALBUM,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface ChooserContentType {}
+
+ /**
+ * Indicates that the content being shared with {@link #ACTION_SEND} represents an album
+ * (e.g. containing photos).
+ *
+ * @see #EXTRA_CHOOSER_CONTENT_TYPE_HINT
+ */
+ @FlaggedApi(android.service.chooser.Flags.FLAG_CHOOSER_ALBUM_TEXT)
+ public static final int CHOOSER_CONTENT_TYPE_ALBUM = 1;
+
+ /**
* An {@code ArrayList} of {@code String} annotations describing content for
* {@link #ACTION_CHOOSER}.
*
diff --git a/core/java/android/service/chooser/flags.aconfig b/core/java/android/service/chooser/flags.aconfig
index 8aeaacf..3cc7f5a 100644
--- a/core/java/android/service/chooser/flags.aconfig
+++ b/core/java/android/service/chooser/flags.aconfig
@@ -1,6 +1,13 @@
package: "android.service.chooser"
flag {
+ name: "chooser_album_text"
+ namespace: "intentresolver"
+ description: "Flag controlling the album text subtype hint for sharesheet"
+ bug: "323380224"
+}
+
+flag {
name: "support_nfc_resolver"
namespace: "systemui"
description: "This flag controls the new NFC 'resolver' activity"