@Test public void testGetSafeBrowsingPrivacyPolicyUrl() throws Exception { assumeTrue( WebViewFeature.isFeatureSupported(WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL)); assertNotNull(WebViewCompat.getSafeBrowsingPrivacyPolicyUrl()); try { new URL(WebViewCompat.getSafeBrowsingPrivacyPolicyUrl().toString()); } catch (MalformedURLException e) { Assert.fail("The privacy policy URL should be a well-formed URL"); } }
@SuppressLint("NewApi") @NonNull @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") public static Uri getSafeBrowsingPrivacyPolicyUrl() { WebViewFeatureInternal webviewFeature = WebViewFeatureInternal.getFeature(WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL); if (webviewFeature.isSupportedByFramework()) { return WebView.getSafeBrowsingPrivacyPolicyUrl(); } else if (webviewFeature.isSupportedByWebView()) { return getFactory().getStatics().getSafeBrowsingPrivacyPolicyUrl(); } else { throw WebViewFeatureInternal.getUnsupportedOperationException(); } }
WebViewCompat { @SuppressLint("NewApi") @NonNull @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") public static Uri getSafeBrowsingPrivacyPolicyUrl() { WebViewFeatureInternal webviewFeature = WebViewFeatureInternal.getFeature(WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL); if (webviewFeature.isSupportedByFramework()) { return WebView.getSafeBrowsingPrivacyPolicyUrl(); } else if (webviewFeature.isSupportedByWebView()) { return getFactory().getStatics().getSafeBrowsingPrivacyPolicyUrl(); } else { throw WebViewFeatureInternal.getUnsupportedOperationException(); } } }
WebViewCompat { @SuppressLint("NewApi") @NonNull @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") public static Uri getSafeBrowsingPrivacyPolicyUrl() { WebViewFeatureInternal webviewFeature = WebViewFeatureInternal.getFeature(WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL); if (webviewFeature.isSupportedByFramework()) { return WebView.getSafeBrowsingPrivacyPolicyUrl(); } else if (webviewFeature.isSupportedByWebView()) { return getFactory().getStatics().getSafeBrowsingPrivacyPolicyUrl(); } else { throw WebViewFeatureInternal.getUnsupportedOperationException(); } } private  WebViewCompat(); }
WebViewCompat { @SuppressLint("NewApi") @NonNull @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") public static Uri getSafeBrowsingPrivacyPolicyUrl() { WebViewFeatureInternal webviewFeature = WebViewFeatureInternal.getFeature(WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL); if (webviewFeature.isSupportedByFramework()) { return WebView.getSafeBrowsingPrivacyPolicyUrl(); } else if (webviewFeature.isSupportedByWebView()) { return getFactory().getStatics().getSafeBrowsingPrivacyPolicyUrl(); } else { throw WebViewFeatureInternal.getUnsupportedOperationException(); } } private  WebViewCompat(); @SuppressWarnings("NewApi") @RequiresFeature(name = WebViewFeature.VISUAL_STATE_CALLBACK, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") static void postVisualStateCallback(@NonNull WebView webview, long requestId,
            @NonNull final VisualStateCallback callback); @SuppressLint("NewApi") @RequiresFeature(name = WebViewFeature.START_SAFE_BROWSING, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") static void startSafeBrowsing(@NonNull Context context,
            @Nullable ValueCallback<Boolean> callback); @SuppressLint("NewApi") @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_WHITELIST, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") static void setSafeBrowsingWhitelist(@NonNull List<String> hosts,
            @Nullable ValueCallback<Boolean> callback); @SuppressLint("NewApi") @NonNull @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") static Uri getSafeBrowsingPrivacyPolicyUrl(); @Nullable static PackageInfo getCurrentWebViewPackage(@NonNull Context context); static @NonNull WebMessagePortCompat[] createWebMessageChannel(
            @NonNull WebView webview); static void postWebMessage(@NonNull WebView webview, @NonNull WebMessageCompat message,
            @NonNull Uri targetOrigin); }
WebViewCompat { @SuppressLint("NewApi") @NonNull @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") public static Uri getSafeBrowsingPrivacyPolicyUrl() { WebViewFeatureInternal webviewFeature = WebViewFeatureInternal.getFeature(WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL); if (webviewFeature.isSupportedByFramework()) { return WebView.getSafeBrowsingPrivacyPolicyUrl(); } else if (webviewFeature.isSupportedByWebView()) { return getFactory().getStatics().getSafeBrowsingPrivacyPolicyUrl(); } else { throw WebViewFeatureInternal.getUnsupportedOperationException(); } } private  WebViewCompat(); @SuppressWarnings("NewApi") @RequiresFeature(name = WebViewFeature.VISUAL_STATE_CALLBACK, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") static void postVisualStateCallback(@NonNull WebView webview, long requestId,
            @NonNull final VisualStateCallback callback); @SuppressLint("NewApi") @RequiresFeature(name = WebViewFeature.START_SAFE_BROWSING, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") static void startSafeBrowsing(@NonNull Context context,
            @Nullable ValueCallback<Boolean> callback); @SuppressLint("NewApi") @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_WHITELIST, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") static void setSafeBrowsingWhitelist(@NonNull List<String> hosts,
            @Nullable ValueCallback<Boolean> callback); @SuppressLint("NewApi") @NonNull @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_PRIVACY_POLICY_URL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") static Uri getSafeBrowsingPrivacyPolicyUrl(); @Nullable static PackageInfo getCurrentWebViewPackage(@NonNull Context context); static @NonNull WebMessagePortCompat[] createWebMessageChannel(
            @NonNull WebView webview); static void postWebMessage(@NonNull WebView webview, @NonNull WebMessageCompat message,
            @NonNull Uri targetOrigin);  }