Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c0171fe authored by Kevin Jeon's avatar Kevin Jeon
Browse files

Deprecate Linkify.ALL

This change deprecates Linkify.ALL because it uses
Linkify.MAP_ADDRESSES, which is deprecated. The deprecation message is
the same as the one for MAP_ADDRESSES; users are directed to use
TextClassifier.generateLinks() instead.

Bug: 202556787
Test: N/A

Change-Id: I40a344410d2794f590d72faa6fcd9bf4582449bf
parent 2e7d9776
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45757,7 +45757,7 @@ package android.text.util {
    method public static final boolean addLinks(@NonNull android.text.Spannable, @NonNull java.util.regex.Pattern, @Nullable String, @Nullable android.text.util.Linkify.MatchFilter, @Nullable android.text.util.Linkify.TransformFilter);
    method public static final boolean addLinks(@NonNull android.text.Spannable, @NonNull java.util.regex.Pattern, @Nullable String, @Nullable String[], @Nullable android.text.util.Linkify.MatchFilter, @Nullable android.text.util.Linkify.TransformFilter);
    method public static final boolean addLinks(@NonNull android.text.Spannable, @NonNull java.util.regex.Pattern, @Nullable String, @Nullable String[], @Nullable android.text.util.Linkify.MatchFilter, @Nullable android.text.util.Linkify.TransformFilter, @Nullable java.util.function.Function<java.lang.String,android.text.style.URLSpan>);
    field public static final int ALL = 15; // 0xf
    field @Deprecated public static final int ALL = 15; // 0xf
    field public static final int EMAIL_ADDRESSES = 2; // 0x2
    field @Deprecated public static final int MAP_ADDRESSES = 8; // 0x8
    field public static final int PHONE_NUMBERS = 4; // 0x4
+13 −7
Original line number Diff line number Diff line
@@ -111,19 +111,25 @@ public class Linkify {
     *  {@link android.webkit.WebView#findAddress(String)} for more information.
     *
     *  @deprecated use {@link android.view.textclassifier.TextClassifier#generateLinks(
     *  TextLinks.Request)} instead and avoid it even when targeting API levels where no alternative
     *  is available.
     *  TextLinks.Request)} instead, and avoid {@link #MAP_ADDRESSES} even when targeting API levels
     *  where no alternative is available.
     */
    @Deprecated
    public static final int MAP_ADDRESSES = 0x08;

    /**
     *  Bit mask indicating that all available patterns should be matched in
     *  methods that take an options mask
     *  <p><strong>Note:</strong></p> {@link #MAP_ADDRESSES} is deprecated.
     *  Use {@link android.view.textclassifier.TextClassifier#generateLinks(TextLinks.Request)}
     *  instead and avoid it even when targeting API levels where no alternative is available.
     *  Bit mask indicating that all available patterns should be matched in methods
     *  that take an options mask. Note that this should be avoided, as the {@link
     *  #MAP_ADDRESSES} field uses the {@link android.webkit.WebView#findAddress(
     *  String)} method, which has various limitations and has been deprecated: see
     *  the documentation for {@link android.webkit.WebView#findAddress(String)} for
     *  more information.
     *
     *  @deprecated use {@link android.view.textclassifier.TextClassifier#generateLinks(
     *  TextLinks.Request)} instead, and avoid {@link #ALL} even when targeting API levels where no
     *  alternative is available.
     */
    @Deprecated
    public static final int ALL = WEB_URLS | EMAIL_ADDRESSES | PHONE_NUMBERS | MAP_ADDRESSES;

    /**