From f4d85d806e72b7a349123f870bc2712fe01b55d5 Mon Sep 17 00:00:00 2001 From: Tobias Sargeant Date: Fri, 5 Jan 2018 14:34:38 +0000 Subject: Add a Java FindAddress implentation. This stops calling findAddress (possibly indirectly via Linkify) from loading webview native code, resulting in a performance and memory improvement for those apps that call WebView#findAddress but do not otherwise use WebView. Bug: 22362008 Test: Existing WebView CTS test. Change-Id: I5fcab725ceaf0d6a00e931d3b6cd2f3799d68391 --- core/java/android/webkit/WebView.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/java/android/webkit/WebView.java') diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 637b60e2dcb4..244b6bd51f96 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -1797,9 +1797,10 @@ public class WebView extends AbsoluteLayout * @return the address, or if no address is found, null */ public static String findAddress(String addr) { - // TODO: Rewrite this in Java so it is not needed to start up chromium - // Could also be deprecated - return getFactory().getStatics().findAddress(addr); + if (addr == null) { + throw new NullPointerException("addr is null"); + } + return FindAddress.findAddress(addr); } /** -- cgit v1.2.3