diff options
author | 2024-10-17 19:47:09 +0000 | |
---|---|---|
committer | 2024-10-17 22:47:46 +0000 | |
commit | ed1bf52d0f4cd8153dd4fc23e5611e7331f3ba0d (patch) | |
tree | 30b7128b1a27993bcea1fa727b27242eb8abe29b | |
parent | 4e1317ffb49cd2ff98fdee700114a98209c93089 (diff) |
Deprecate WebView.startSafeBrowsing API
Flag: android.webkit.deprecate_start_safe_browsing
Bug: 372193372
Change-Id: I06c0ffe2fa27b5afa94456b74676c2faadd27d99
-rw-r--r-- | core/api/current.txt | 2 | ||||
-rw-r--r-- | core/java/android/webkit/WebView.java | 7 | ||||
-rw-r--r-- | core/java/android/webkit/flags.aconfig | 8 |
3 files changed, 16 insertions, 1 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 14a91c9033c5..007fa912276a 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -58512,7 +58512,7 @@ package android.webkit { method public void setWebViewRenderProcessClient(@Nullable android.webkit.WebViewRenderProcessClient); method @Deprecated public boolean shouldDelayChildPressedState(); method @Deprecated public boolean showFindDialog(@Nullable String, boolean); - method public static void startSafeBrowsing(@NonNull android.content.Context, @Nullable android.webkit.ValueCallback<java.lang.Boolean>); + method @Deprecated @FlaggedApi("android.webkit.deprecate_start_safe_browsing") public static void startSafeBrowsing(@NonNull android.content.Context, @Nullable 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 ffe8c80023c4..b6663992b851 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -17,6 +17,7 @@ package android.webkit; import android.annotation.CallbackExecutor; +import android.annotation.FlaggedApi; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; @@ -1495,7 +1496,13 @@ public class WebView extends AbsoluteLayout * @param context Application Context. * @param callback will be called on the UI thread with {@code true} if initialization is * successful, {@code false} otherwise. + * @deprecated In WebView version 122.0.6174.0 and later, this initialization is done + * automatically, so there is no need to call this API. If called, this API will invoke + * the {@code callback} immediately with {@code true}, given that Safe Browsing + * is enabled and supported on the device. */ + @Deprecated + @FlaggedApi(android.webkit.Flags.FLAG_DEPRECATE_START_SAFE_BROWSING) public static void startSafeBrowsing(@NonNull Context context, @Nullable ValueCallback<Boolean> callback) { getFactory().getStatics().initSafeBrowsing(context, callback); diff --git a/core/java/android/webkit/flags.aconfig b/core/java/android/webkit/flags.aconfig index d1013a92476f..ba79ef574532 100644 --- a/core/java/android/webkit/flags.aconfig +++ b/core/java/android/webkit/flags.aconfig @@ -11,6 +11,14 @@ flag { } flag { + name: "deprecate_start_safe_browsing" + is_exported: true + namespace: "webview" + description: "Deprecating startSafeBrowsing API because it is a NOOP" + bug: "372193372" +} + +flag { name: "mainline_apis" is_exported: true namespace: "webview" |