Open new Chooser custom actions API.

Open new Chooser custom actions API, address linter errors.

Bug: 259947071
Test: presubmit
Change-Id: I49408d70644edbb9ad4d27316c67a37d81f2ec3d
This commit is contained in:
Andrey Epin
2022-12-27 15:40:34 -08:00
parent 2b47445bb9
commit 5e48fe8daf
3 changed files with 21 additions and 7 deletions

View File

@@ -10626,6 +10626,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";
@@ -39358,6 +39359,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();

View File

@@ -5830,10 +5830,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}.
@@ -5844,7 +5843,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

View File

@@ -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);
}