android-components / mozilla.components.feature.sitepermissions / SitePermissionsFeature

SitePermissionsFeature

class SitePermissionsFeature : LifecycleAwareFeature, PermissionsFeature (source)

This feature will subscribe to the currently selected Session and display a suitable dialogs based on Session.Observer.onAppPermissionRequested or Session.Observer.onContentPermissionRequested events. Once the dialog is closed the PermissionRequest will be consumed.

Types

Name Summary
DialogConfig data class DialogConfig
Customization options for feature request dialog
PromptsStyling data class PromptsStyling

Constructors

Name Summary
<init> SitePermissionsFeature(context: <ERROR CLASS>, sessionManager: SessionManager, sessionId: String? = null, storage: SitePermissionsStorage = SitePermissionsStorage(context), sitePermissionsRules: SitePermissionsRules? = null, fragmentManager: FragmentManager, promptsStyling: PromptsStyling? = null, dialogConfig: DialogConfig? = null, onNeedToRequestPermissions: OnNeedToRequestPermissions)
This feature will subscribe to the currently selected Session and display a suitable dialogs based on Session.Observer.onAppPermissionRequested or Session.Observer.onContentPermissionRequested events. Once the dialog is closed the PermissionRequest will be consumed.

Properties

Name Summary
onNeedToRequestPermissions val onNeedToRequestPermissions: OnNeedToRequestPermissions
a callback invoked when permissions need to be requested. Once the request is completed, onPermissionsResult needs to be invoked.
promptsStyling var promptsStyling: PromptsStyling?
optional styling for prompts.
sitePermissionsRules var sitePermissionsRules: SitePermissionsRules?
indicates how permissions should behave per permission category.

Functions

Name Summary
onPermissionsResult fun onPermissionsResult(permissions: Array<String>, grantResults: IntArray): Unit
Notifies the feature that the permissions requested were completed.
start fun start(): Unit
stop fun stop(): Unit