diff options
| -rw-r--r-- | api/current.txt | 3 | ||||
| -rw-r--r-- | api/system-current.txt | 4 | ||||
| -rw-r--r-- | api/test-current.txt | 3 | ||||
| -rw-r--r-- | core/java/android/webkit/WebView.java | 38 | ||||
| -rw-r--r-- | core/java/android/webkit/WebViewFactoryProvider.java | 8 |
5 files changed, 16 insertions, 40 deletions
diff --git a/api/current.txt b/api/current.txt index 4f117ee00ae9..abab416cadbc 100644 --- a/api/current.txt +++ b/api/current.txt @@ -49073,7 +49073,6 @@ package android.webkit { method public void goBack(); method public void goBackOrForward(int); method public void goForward(); - method public static void initSafeBrowsing(android.content.Context, android.webkit.ValueCallback<java.lang.Boolean>); method public void invokeZoomPicker(); method public boolean isPrivateBrowsingEnabled(); method public void loadData(java.lang.String, java.lang.String, java.lang.String); @@ -49121,7 +49120,7 @@ package android.webkit { method public void setWebViewClient(android.webkit.WebViewClient); method public deprecated boolean shouldDelayChildPressedState(); method public deprecated boolean showFindDialog(java.lang.String, boolean); - method public static void shutdownSafeBrowsing(); + method public static void startSafeBrowsing(android.content.Context, android.webkit.ValueCallback<java.lang.Boolean>); method public void stopLoading(); method public void zoomBy(float); method public boolean zoomIn(); diff --git a/api/system-current.txt b/api/system-current.txt index e8c56f02fb77..427f5a91cd73 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -52757,7 +52757,6 @@ package android.webkit { method public void goBack(); method public void goBackOrForward(int); method public void goForward(); - method public static void initSafeBrowsing(android.content.Context, android.webkit.ValueCallback<java.lang.Boolean>); method public void invokeZoomPicker(); method public boolean isPrivateBrowsingEnabled(); method public void loadData(java.lang.String, java.lang.String, java.lang.String); @@ -52805,7 +52804,7 @@ package android.webkit { method public void setWebViewClient(android.webkit.WebViewClient); method public deprecated boolean shouldDelayChildPressedState(); method public deprecated boolean showFindDialog(java.lang.String, boolean); - method public static void shutdownSafeBrowsing(); + method public static void startSafeBrowsing(android.content.Context, android.webkit.ValueCallback<java.lang.Boolean>); method public void stopLoading(); method public void zoomBy(float); method public boolean zoomIn(); @@ -53002,7 +53001,6 @@ package android.webkit { method public abstract android.net.Uri[] parseFileChooserResult(int, android.content.Intent); method public abstract void setSafeBrowsingWhitelist(java.util.List<java.lang.String>, android.webkit.ValueCallback<java.lang.Boolean>); method public abstract void setWebContentsDebuggingEnabled(boolean); - method public abstract void shutdownSafeBrowsing(); } public class WebViewFragment extends android.app.Fragment { diff --git a/api/test-current.txt b/api/test-current.txt index 56308b0f9ff0..4aa053eb46da 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -49528,7 +49528,6 @@ package android.webkit { method public void goBack(); method public void goBackOrForward(int); method public void goForward(); - method public static void initSafeBrowsing(android.content.Context, android.webkit.ValueCallback<java.lang.Boolean>); method public void invokeZoomPicker(); method public boolean isPrivateBrowsingEnabled(); method public void loadData(java.lang.String, java.lang.String, java.lang.String); @@ -49576,7 +49575,7 @@ package android.webkit { method public void setWebViewClient(android.webkit.WebViewClient); method public deprecated boolean shouldDelayChildPressedState(); method public deprecated boolean showFindDialog(java.lang.String, boolean); - method public static void shutdownSafeBrowsing(); + method public static void startSafeBrowsing(android.content.Context, android.webkit.ValueCallback<java.lang.Boolean>); method public void stopLoading(); method public void zoomBy(float); method public boolean zoomIn(); diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 049f1efbb101..4b98e350f8b5 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -1628,42 +1628,28 @@ public class WebView extends AbsoluteLayout } /** - * Starts Safe Browsing initialization. This should only be called once. - * + * Starts Safe Browsing initialization. * <p> - * Because the Safe Browsing feature takes time to initialize, WebView may temporarily whitelist - * URLs until the feature is ready. The callback will be invoked with true once initialization - * is complete. - * </p> - * + * URL loads are not guaranteed to be protected by Safe Browsing until after {@code callback} is + * invoked with {@code true}. Safe Browsing is not fully supported on all devices. For those + * devices {@code callback} will receive {@code false}. * <p> - * This does not enable the Safe Browsing feature itself, and should only be used if the feature - * is otherwise enabled. - * </p> - * + * This does not enable the Safe Browsing feature itself, and should only be called if Safe + * Browsing is enabled by the manifest tag or {@link WebSettings#setSafeBrowsingEnabled}. This + * prepares resources used for Safe Browsing. * <p> - * This does not require an Activity Context, and will always use the application Context to do - * its work. - * </p> + * This should be called with the Application Context (and will always use the Application + * context to do its work regardless). * * @param context Application Context. - * @param callback will be called with the value true if initialization is - * successful. The callback will be run on the UI thread. + * @param callback will be called on the UI thread with {@code true} if initialization is + * successful, {@code false} otherwise. */ - public static void initSafeBrowsing(Context context, ValueCallback<Boolean> callback) { + public static void startSafeBrowsing(Context context, ValueCallback<Boolean> callback) { getFactory().getStatics().initSafeBrowsing(context, callback); } /** - * Shuts down Safe Browsing. This should only be called once. This does not disable the feature, - * it only frees resources used by Safe Browsing code. To disable Safe Browsing on an individual - * WebView, see {@link WebSettings#setSafeBrowsingEnabled} - */ - public static void shutdownSafeBrowsing() { - getFactory().getStatics().shutdownSafeBrowsing(); - } - - /** * Sets the list of domains that are exempt from SafeBrowsing checks. The list is * global for all the WebViews. * <p> diff --git a/core/java/android/webkit/WebViewFactoryProvider.java b/core/java/android/webkit/WebViewFactoryProvider.java index 4f6513fe1bc8..4c47abc65a65 100644 --- a/core/java/android/webkit/WebViewFactoryProvider.java +++ b/core/java/android/webkit/WebViewFactoryProvider.java @@ -80,17 +80,11 @@ public interface WebViewFactoryProvider { /** * Implement the API method - * {@link android.webkit.WebView#initSafeBrowsing(Context , ValueCallback<Boolean>)} + * {@link android.webkit.WebView#startSafeBrowsing(Context , ValueCallback<Boolean>)} */ void initSafeBrowsing(Context context, ValueCallback<Boolean> callback); /** - * Implement the API method - * {@link android.webkit.WebView#shutdownSafeBrowsing()} - */ - void shutdownSafeBrowsing(); - - /** * Implement the API method * {@link android.webkit.WebView#setSafeBrowsingWhitelist(List<String>, * ValueCallback<Boolean>)} |