Merge "Add deprecation notice to Linkify MAP_ADDRESSES" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-04-06 14:55:00 +00:00
committed by Android (Google) Code Review
3 changed files with 14 additions and 3 deletions

View File

@@ -44696,7 +44696,7 @@ package android.text.util {
method public static final boolean addLinks(android.text.Spannable, java.util.regex.Pattern, java.lang.String, java.lang.String[], android.text.util.Linkify.MatchFilter, android.text.util.Linkify.TransformFilter);
field public static final int ALL = 15; // 0xf
field public static final int EMAIL_ADDRESSES = 2; // 0x2
field public static final int MAP_ADDRESSES = 8; // 0x8
field public static final deprecated int MAP_ADDRESSES = 8; // 0x8
field public static final int PHONE_NUMBERS = 4; // 0x4
field public static final int WEB_URLS = 1; // 0x1
field public static final android.text.util.Linkify.MatchFilter sPhoneNumberMatchFilter;
@@ -51315,7 +51315,7 @@ package android.webkit {
method public void documentHasImages(android.os.Message);
method public static void enableSlowWholeDocumentDraw();
method public void evaluateJavascript(java.lang.String, android.webkit.ValueCallback<java.lang.String>);
method public static java.lang.String findAddress(java.lang.String);
method public static deprecated java.lang.String findAddress(java.lang.String);
method public deprecated int findAll(java.lang.String);
method public void findAllAsync(java.lang.String);
method public void findNext(boolean);

View File

@@ -100,13 +100,20 @@ public class Linkify {
* take an options mask. Note that this uses the
* {@link android.webkit.WebView#findAddress(String) findAddress()} method in
* {@link android.webkit.WebView} for finding addresses, which has various
* limitations.
* limitations and has been deprecated.
* @deprecated use {@link android.view.textclassifier.TextClassifier#generateLinks(
* TextLinks.Request)} instead and avoid it 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.
*/
public static final int ALL = WEB_URLS | EMAIL_ADDRESSES | PHONE_NUMBERS | MAP_ADDRESSES;

View File

@@ -1837,8 +1837,12 @@ public class WebView extends AbsoluteLayout
*
* @param addr the string to search for addresses
* @return the address, or if no address is found, {@code null}
* @deprecated this method is superseded by {@link TextClassifier#generateLinks(
* android.view.textclassifier.TextLinks.Request)}. Avoid using this method even when targeting
* API levels where no alternative is available.
*/
@Nullable
@Deprecated
public static String findAddress(String addr) {
if (addr == null) {
throw new NullPointerException("addr is null");