WebViewMediaIntegrityApiStatusConfig


@RequiresFeature(name = WebViewFeature.WEBVIEW_MEDIA_INTEGRITY_API_STATUS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
public class WebViewMediaIntegrityApiStatusConfig


Configuration to set API enablement status for site origens through override rules.

Websites will follow the default status supplied in the builder constructor, unless the site origen matches one of the origen patterns supplied in the override rules.

The override rules are a map from origen patterns to the desired WebViewMediaIntegrityApiStatus.

Summary

Nested types

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

Constants

static final int

Disables the WebView Media Integrity API and causes it to return an error code to the JavaScript callers indicating that the app has disabled it.

static final int

Enables the WebView Media Integrity API and allows sharing of the app package name with the JavaScript caller.

static final int

Enables the WebView Media Integrity API for JavaScript callers but disables sharing app package name in generated tokens.

Public methods

int

Returns the default value for origens that don't match any override rules.

@NonNull Map<StringInteger>

Get the explicitly set override rules.

Constants

WEBVIEW_MEDIA_INTEGRITY_API_DISABLED

Added in 1.10.0
public static final int WEBVIEW_MEDIA_INTEGRITY_API_DISABLED = 0

Disables the WebView Media Integrity API and causes it to return an error code to the JavaScript callers indicating that the app has disabled it.

WEBVIEW_MEDIA_INTEGRITY_API_ENABLED

Added in 1.10.0
public static final int WEBVIEW_MEDIA_INTEGRITY_API_ENABLED = 2

Enables the WebView Media Integrity API and allows sharing of the app package name with the JavaScript caller.

This is the default value.

WEBVIEW_MEDIA_INTEGRITY_API_ENABLED_WITHOUT_APP_IDENTITY

Added in 1.10.0
public static final int WEBVIEW_MEDIA_INTEGRITY_API_ENABLED_WITHOUT_APP_IDENTITY = 1

Enables the WebView Media Integrity API for JavaScript callers but disables sharing app package name in generated tokens.

Public constructors

WebViewMediaIntegrityApiStatusConfig

Added in 1.10.0
public WebViewMediaIntegrityApiStatusConfig(
    @NonNull WebViewMediaIntegrityApiStatusConfig.Builder builder
)

Public methods

getDefaultStatus

Added in 1.10.0
public int getDefaultStatus()

Returns the default value for origens that don't match any override rules.

getOverrideRules

Added in 1.10.0
public @NonNull Map<StringIntegergetOverrideRules()

Get the explicitly set override rules.

This is a map from origen patterns to their desired WebView Media Integrity API statuses.