diff --git a/api/current.txt b/api/current.txt index 25cac5c2a16e8..e46bdb809d789 100644 --- a/api/current.txt +++ b/api/current.txt @@ -37202,8 +37202,10 @@ package android.service.autofill { } public static class ImageTransformation.Builder { - ctor public ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int); - method public android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int); + ctor public deprecated ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int); + ctor public ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int, java.lang.CharSequence); + method public deprecated android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int); + method public android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int, java.lang.CharSequence); method public android.service.autofill.ImageTransformation build(); } diff --git a/api/system-current.txt b/api/system-current.txt index 82cdbaf541f76..361a35eaa0145 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -40297,8 +40297,10 @@ package android.service.autofill { } public static class ImageTransformation.Builder { - ctor public ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int); - method public android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int); + ctor public deprecated ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int); + ctor public ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int, java.lang.CharSequence); + method public deprecated android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int); + method public android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int, java.lang.CharSequence); method public android.service.autofill.ImageTransformation build(); } diff --git a/api/test-current.txt b/api/test-current.txt index 34b663be5db6b..a8da6509a8747 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -37492,8 +37492,10 @@ package android.service.autofill { } public static class ImageTransformation.Builder { - ctor public ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int); - method public android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int); + ctor public deprecated ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int); + ctor public ImageTransformation.Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int, java.lang.CharSequence); + method public deprecated android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int); + method public android.service.autofill.ImageTransformation.Builder addOption(java.util.regex.Pattern, int, java.lang.CharSequence); method public android.service.autofill.ImageTransformation build(); } diff --git a/core/java/android/service/autofill/ImageTransformation.java b/core/java/android/service/autofill/ImageTransformation.java index 2151f74fbe5b2..4afda249afea4 100644 --- a/core/java/android/service/autofill/ImageTransformation.java +++ b/core/java/android/service/autofill/ImageTransformation.java @@ -20,11 +20,12 @@ import static android.view.autofill.Helper.sDebug; import android.annotation.DrawableRes; import android.annotation.NonNull; +import android.annotation.Nullable; import android.annotation.TestApi; import android.os.Parcel; import android.os.Parcelable; +import android.text.TextUtils; import android.util.Log; -import android.util.Pair; import android.view.autofill.AutofillId; import android.widget.ImageView; import android.widget.RemoteViews; @@ -43,9 +44,9 @@ import java.util.regex.Pattern; * *
  *   new ImageTransformation.Builder(ccNumberId, Pattern.compile("^4815.*$"),
- *                                   R.drawable.ic_credit_card_logo1)
- *     .addOption(Pattern.compile("^1623.*$"), R.drawable.ic_credit_card_logo2)
- *     .addOption(Pattern.compile("^42.*$"), R.drawable.ic_credit_card_logo3)
+ *                                   R.drawable.ic_credit_card_logo1, "Brand 1")
+ *     .addOption(Pattern.compile("^1623.*$"), R.drawable.ic_credit_card_logo2, "Brand 2")
+ *     .addOption(Pattern.compile("^42.*$"), R.drawable.ic_credit_card_logo3, "Brand 3")
  *     .build();
  * 
* @@ -59,7 +60,7 @@ public final class ImageTransformation extends InternalTransformation implements private static final String TAG = "ImageTransformation"; private final AutofillId mId; - private final ArrayList> mOptions; + private final ArrayList