WebViewMediaIntegrityApiStatusConfig


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


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

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

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

Summary

Nested types

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

Constants

const 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.

const Int

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

const Int

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

Public functions

Int

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

(Mutable)Map<String!, Int!>

Get the explicitly set override rules.

Constants

WEBVIEW_MEDIA_INTEGRITY_API_DISABLED

Added in 1.10.0
const val WEBVIEW_MEDIA_INTEGRITY_API_DISABLED = 0: 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.

WEBVIEW_MEDIA_INTEGRITY_API_ENABLED

Added in 1.10.0
const val WEBVIEW_MEDIA_INTEGRITY_API_ENABLED = 2: Int

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
const val WEBVIEW_MEDIA_INTEGRITY_API_ENABLED_WITHOUT_APP_IDENTITY = 1: Int

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
WebViewMediaIntegrityApiStatusConfig(
    builder: WebViewMediaIntegrityApiStatusConfig.Builder
)

Public functions

getDefaultStatus

Added in 1.10.0
fun getDefaultStatus(): Int

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

getOverrideRules

Added in 1.10.0
fun getOverrideRules(): (Mutable)Map<String!, Int!>

Get the explicitly set override rules.

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