summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Aashna Jena <aashnajena@google.com> 2024-10-18 09:22:31 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-10-18 09:22:31 +0000
commit0ecea680dc93c095996ad2d4fb998a21e6d7c77e (patch)
tree0e53de4736fd6564fdff69361537e668f040ea55
parent1ae474dad13d5c5292d215ccfe35b12077baa40b (diff)
parented1bf52d0f4cd8153dd4fc23e5611e7331f3ba0d (diff)
Merge "Deprecate WebView.startSafeBrowsing API" into main
-rw-r--r--core/api/current.txt2
-rw-r--r--core/java/android/webkit/WebView.java7
-rw-r--r--core/java/android/webkit/flags.aconfig8
3 files changed, 16 insertions, 1 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index b053c4a0f895..b00c8985eeac 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -58545,7 +58545,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 b2f1c9af251d..c9e94d2f57f6 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"