Merge "Open new Chooser custom actions API."
This commit is contained in:
@@ -10712,6 +10712,7 @@ package android.content {
|
||||
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 public static final String EXTRA_CHOOSER_CUSTOM_ACTIONS = "android.intent.extra.CHOOSER_CUSTOM_ACTIONS";
|
||||
field public static final String EXTRA_CHOOSER_REFINEMENT_INTENT_SENDER = "android.intent.extra.CHOOSER_REFINEMENT_INTENT_SENDER";
|
||||
field public static final String EXTRA_CHOOSER_TARGETS = "android.intent.extra.CHOOSER_TARGETS";
|
||||
field public static final String EXTRA_CHOSEN_COMPONENT = "android.intent.extra.CHOSEN_COMPONENT";
|
||||
@@ -39533,6 +39534,20 @@ package android.service.carrier {
|
||||
|
||||
package android.service.chooser {
|
||||
|
||||
public final class ChooserAction implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method @NonNull public android.app.PendingIntent getAction();
|
||||
method @NonNull public android.graphics.drawable.Icon getIcon();
|
||||
method @NonNull public CharSequence getLabel();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.service.chooser.ChooserAction> CREATOR;
|
||||
}
|
||||
|
||||
public static final class ChooserAction.Builder {
|
||||
ctor public ChooserAction.Builder(@NonNull android.graphics.drawable.Icon, @NonNull CharSequence, @NonNull android.app.PendingIntent);
|
||||
method @NonNull public android.service.chooser.ChooserAction build();
|
||||
}
|
||||
|
||||
@Deprecated public final class ChooserTarget implements android.os.Parcelable {
|
||||
ctor @Deprecated public ChooserTarget(CharSequence, android.graphics.drawable.Icon, float, android.content.ComponentName, @Nullable android.os.Bundle);
|
||||
method @Deprecated public int describeContents();
|
||||
|
||||
@@ -5819,10 +5819,9 @@ public class Intent implements Parcelable, Cloneable {
|
||||
/**
|
||||
* A Parcelable[] of {@link ChooserAction} objects to provide the Android Sharesheet with
|
||||
* app-specific actions to be presented to the user when invoking {@link #ACTION_CHOOSER}.
|
||||
* @hide
|
||||
*/
|
||||
public static final String EXTRA_CHOOSER_CUSTOM_ACTIONS =
|
||||
"android.intent.extra.EXTRA_CHOOSER_CUSTOM_ACTIONS";
|
||||
"android.intent.extra.CHOOSER_CUSTOM_ACTIONS";
|
||||
|
||||
/**
|
||||
* Optional argument to be used with {@link #ACTION_CHOOSER}.
|
||||
@@ -5833,7 +5832,7 @@ public class Intent implements Parcelable, Cloneable {
|
||||
* @hide
|
||||
*/
|
||||
public static final String EXTRA_CHOOSER_PAYLOAD_RESELECTION_ACTION =
|
||||
"android.intent.extra.EXTRA_CHOOSER_PAYLOAD_RESELECTION_ACTION";
|
||||
"android.intent.extra.CHOOSER_PAYLOAD_RESELECTION_ACTION";
|
||||
|
||||
/**
|
||||
* An {@code ArrayList} of {@code String} annotations describing content for
|
||||
|
||||
@@ -27,11 +27,9 @@ import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A ChooserAction is an app-defined action that can be provided to the Android Sharesheet to
|
||||
* be shown to the user when {@link android.content.Intent.ACTION_CHOOSER} is invoked.
|
||||
* be shown to the user when {@link android.content.Intent#ACTION_CHOOSER} is invoked.
|
||||
*
|
||||
* @see android.content.Intent.EXTRA_CHOOSER_CUSTOM_ACTIONS
|
||||
* @see android.content.Intent.EXTRA_CHOOSER_PAYLOAD_RESELECTION_ACTION
|
||||
* @hide
|
||||
* @see android.content.Intent#EXTRA_CHOOSER_CUSTOM_ACTIONS
|
||||
*/
|
||||
public final class ChooserAction implements Parcelable {
|
||||
private final Icon mIcon;
|
||||
@@ -88,6 +86,7 @@ public final class ChooserAction implements Parcelable {
|
||||
return "ChooserAction {" + "label=" + mLabel + ", intent=" + mAction + "}";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static final Parcelable.Creator<ChooserAction> CREATOR =
|
||||
new Creator<ChooserAction>() {
|
||||
@Override
|
||||
@@ -137,6 +136,7 @@ public final class ChooserAction implements Parcelable {
|
||||
* object.
|
||||
* @return the built action
|
||||
*/
|
||||
@NonNull
|
||||
public ChooserAction build() {
|
||||
return new ChooserAction(mIcon, mLabel, mAction);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user