diff options
| author | Torne (Richard Coles) <torne@google.com> | 2019-06-04 14:14:05 -0400 |
|---|---|---|
| committer | Torne (Richard Coles) <torne@google.com> | 2019-06-04 14:14:05 -0400 |
| commit | aa68ab828873274a141f6463091abd4fa7315a9b (patch) | |
| tree | 06e7bf8d5b342ec1526f99230f5e217b4105410a /core/java/android/webkit/WebView.java | |
| parent | d1ca4823d5dfb53e7c9d15f76f1768ad949ee382 (diff) | |
Clarify problems with Linkify.MAP_ADDRESSES.
Update the documentation for WebView.findAddress, as well as the related
functionality in Linkify and TextView, to clarify why the method is
deprecated, why it should not be used, and that it can cause unexpected
exceptions to be thrown from several places on older OS versions.
Fixes: 24676033
Test: m offline-sdk-docs
Change-Id: I45d82b9a4c9cf62d9566898dd21cd2139ad98f37
Diffstat (limited to 'core/java/android/webkit/WebView.java')
| -rw-r--r-- | core/java/android/webkit/WebView.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 137b67c6e63e..14be73dec41c 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -1603,9 +1603,9 @@ public class WebView extends AbsoluteLayout } /** - * Gets the first substring consisting of the address of a physical - * location. Currently, only addresses in the United States are detected, - * and consist of: + * Gets the first substring which appears to be the address of a physical + * location. Only addresses in the United States can be detected, which + * must consist of: * <ul> * <li>a house number</li> * <li>a street name</li> @@ -1621,9 +1621,17 @@ public class WebView extends AbsoluteLayout * or abbreviated using USPS standards. The house number may not exceed * five digits. * + * <p class="note"><b>Note:</b> This function is deprecated and should be + * avoided on all API levels, as it cannot detect addresses outside of the + * United States and has a high rate of false positives. On API level + * {@link android.os.Build.VERSION_CODES#O_MR1} and earlier, it also causes + * the entire WebView implementation to be loaded and initialized, which + * can throw {@link android.util.AndroidRuntimeException} or other exceptions + * if the WebView implementation is currently being updated. + * * @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( + * @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. */ |
