WebViewMediaIntegrityApiStatusConfig.Builder


class WebViewMediaIntegrityApiStatusConfig.Builder


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

Public constructors

Builder(defaultStatus: Int)

Public functions

WebViewMediaIntegrityApiStatusConfig.Builder
addOverrideRule(originPattern: String, permission: Int)

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

WebViewMediaIntegrityApiStatusConfig

Build the config.

Public constructors

Builder

Added in 1.10.0
Builder(defaultStatus: Int)
Parameters
defaultStatus: Int

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

Public functions

addOverrideRule

Added in 1.10.0
fun addOverrideRule(originPattern: String, permission: Int): WebViewMediaIntegrityApiStatusConfig.Builder

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 addWebMessageListener If two or more origin patterns match a given origin site, the least permissive option will be chosen.

build

Added in 1.10.0
fun build(): WebViewMediaIntegrityApiStatusConfig

Build the config.