WebViewMediaIntegrityApiStatusConfig.Builder


public final 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(int defaultStatus)

Public methods

@NonNull WebViewMediaIntegrityApiStatusConfig.Builder
addOverrideRule(@NonNull 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.

@NonNull WebViewMediaIntegrityApiStatusConfig

Build the config.

Public constructors

Builder

Added in 1.10.0
public Builder(int defaultStatus)
Parameters
int defaultStatus

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

Public methods

addOverrideRule

Added in 1.10.0
public @NonNull WebViewMediaIntegrityApiStatusConfig.Builder addOverrideRule(@NonNull 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 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
public @NonNull WebViewMediaIntegrityApiStatusConfig build()

Build the config.