android-components / mozilla.components.concept.engine.permission / PermissionRequest

PermissionRequest

interface PermissionRequest (source)

Represents a permission request, used when engines need access to protected resources. Every request must be handled by either calling grant or reject.

Properties

permissions

abstract val permissions: List<Permission>

List of requested permissions.

uri

abstract val uri: String?

The origin URI which caused the permissions to be requested.

Functions

grant

abstract fun grant(permissions: List<Permission> = this.permissions): Unit

Grants the provided permissions, or all requested permissions, if none are provided.

grantIf

open fun grantIf(predicate: (Permission) -> Boolean): Boolean

Grants this permission request if the provided predicate is true for any of the requested permissions.

reject

abstract fun reject(): Unit

Rejects the requested permissions.

Inheritors

GeckoPermissionRequest

sealed class GeckoPermissionRequest : PermissionRequest

Gecko-based implementation of PermissionRequest.

SystemPermissionRequest

class SystemPermissionRequest : PermissionRequest

WebView-based implementation of PermissionRequest.