public final class

WebViewMediaIntegrityApiStatusConfig.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.webkit.WebViewMediaIntegrityApiStatusConfig.Builder

Overview

Builds a WebViewMediaIntegrityApiStatusConfig having a default API status and a map of origin pattern rules to their respective API status.

Example:

     // Create a config with default API status being DISABLED and API status is ENABLED for
     // Uris matching origin pattern "http://*.example.com"
     new WebViewMediaIntegrityApiStatusConfig.Builder(WEBVIEW_MEDIA_INTEGRITY_API_DISABLED)
         .addOverrideRule("http://*.example.com", WEBVIEW_MEDIA_INTEGRITY_API_ENABLED)
         .build();
 

Summary

Constructors
publicBuilder(int defaultStatus)

Methods
public WebViewMediaIntegrityApiStatusConfig.BuilderaddOverrideRule(java.lang.String originPattern, int permission)

Add an override rule to set a specific API status for origin sites matching the origin pattern stated in the rule.

public WebViewMediaIntegrityApiStatusConfigbuild()

Build the config.

public WebViewMediaIntegrityApiStatusConfig.BuildersetOverrideRules(java.util.Map<java.lang.String, java.lang.Integer> overrideRules)

Set all required override rules at once using a map of origin patterns to desired API statuses.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(int defaultStatus)

Parameters:

defaultStatus: Default API status that will be used for URIs that don't match any origin pattern rule.

Methods

public WebViewMediaIntegrityApiStatusConfig.Builder addOverrideRule(java.lang.String originPattern, int permission)

Add an override rule to set a specific API status for origin sites matching the origin pattern stated in the rule. Origin patterns should be supplied in the same format as those in WebViewCompat.addWebMessageListener(WebView, String, Set, WebViewCompat.WebMessageListener) If two or more origin patterns match a given origin site, the least permissive option will be chosen.

public WebViewMediaIntegrityApiStatusConfig.Builder setOverrideRules(java.util.Map<java.lang.String, java.lang.Integer> overrideRules)

Set all required override rules at once using a map of origin patterns to desired API statuses. This overwrites existing rules. If two or more origin patterns match a given origin site, the least permissive option will be chosen. This is only meant for internal use within the library.

Build the config.