Interface GeckoSession.PermissionDelegate
- Enclosing class:
- GeckoSession
When denying an Android app permission, the response is not stored by GeckoView. It is the responsibility of the consumer to store the response state and therefore prevent further requests from being presented to the user.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Callback interface for notifying the result of a permission request.static class
Represents a content permission -- including the type of permission, the present value of the permission, the URL the permission pertains to, and other information.static interface
Callback interface for notifying the result of a media permission request, including which media source(s) to use.static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Permission for allowing autoplay of audible video.static final int
Permission for allowing autoplay of inaudible (silent) video.static final int
Permission for using the notifications API.static final int
Permission for using the geolocation API.static final int
Permission for accessing system media keys used to decode DRM media.static final int
Permission for using the storage API.static final int
Permission for third party frames to access first party cookies.static final int
Permission for trackers to operate on the page -- disables all tracking protection features for a given site.static final int
Permission for using the WebXR API. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
onAndroidPermissionsRequest
(GeckoSession session, String[] permissions, GeckoSession.PermissionDelegate.Callback callback) Request Android app permissions.default GeckoResult<Integer>
onContentPermissionRequest
(GeckoSession session, GeckoSession.PermissionDelegate.ContentPermission perm) Request content permission.default void
onMediaPermissionRequest
(GeckoSession session, String uri, GeckoSession.PermissionDelegate.MediaSource[] video, GeckoSession.PermissionDelegate.MediaSource[] audio, GeckoSession.PermissionDelegate.MediaCallback callback) Request content media permissions, including request for which video and/or audio source to use.
-
Field Details
-
PERMISSION_GEOLOCATION
static final int PERMISSION_GEOLOCATIONPermission for using the geolocation API. See: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation- See Also:
-
PERMISSION_DESKTOP_NOTIFICATION
static final int PERMISSION_DESKTOP_NOTIFICATIONPermission for using the notifications API. See: https://developer.mozilla.org/en-US/docs/Web/API/notification- See Also:
-
PERMISSION_PERSISTENT_STORAGE
static final int PERMISSION_PERSISTENT_STORAGEPermission for using the storage API. See: https://developer.mozilla.org/en-US/docs/Web/API/Storage_API- See Also:
-
PERMISSION_XR
static final int PERMISSION_XRPermission for using the WebXR API. See: https://www.w3.org/TR/webxr- See Also:
-
PERMISSION_AUTOPLAY_INAUDIBLE
static final int PERMISSION_AUTOPLAY_INAUDIBLEPermission for allowing autoplay of inaudible (silent) video.- See Also:
-
PERMISSION_AUTOPLAY_AUDIBLE
static final int PERMISSION_AUTOPLAY_AUDIBLEPermission for allowing autoplay of audible video.- See Also:
-
PERMISSION_MEDIA_KEY_SYSTEM_ACCESS
static final int PERMISSION_MEDIA_KEY_SYSTEM_ACCESSPermission for accessing system media keys used to decode DRM media.- See Also:
-
PERMISSION_TRACKING
static final int PERMISSION_TRACKINGPermission for trackers to operate on the page -- disables all tracking protection features for a given site.- See Also:
-
PERMISSION_STORAGE_ACCESS
static final int PERMISSION_STORAGE_ACCESSPermission for third party frames to access first party cookies. May be granted heuristically in some cases.- See Also:
-
-
Method Details
-
onAndroidPermissionsRequest
@UiThread default void onAndroidPermissionsRequest(@NonNull GeckoSession session, @Nullable String[] permissions, @NonNull GeckoSession.PermissionDelegate.Callback callback) Request Android app permissions.- Parameters:
session
- GeckoSession instance requesting the permissions.permissions
- List of permissions to request; possible values are, android.Manifest.permission.ACCESS_COARSE_LOCATION android.Manifest.permission.ACCESS_FINE_LOCATION android.Manifest.permission.CAMERA android.Manifest.permission.RECORD_AUDIOcallback
- Callback interface.
-
onContentPermissionRequest
@UiThread @Nullable default GeckoResult<Integer> onContentPermissionRequest(@NonNull GeckoSession session, @NonNull GeckoSession.PermissionDelegate.ContentPermission perm) Request content permission.Note, that in the case of PERMISSION_PERSISTENT_STORAGE, once permission has been granted for a site, it cannot be revoked. If the permission has previously been granted, it is the responsibility of the consuming app to remember the permission and prevent the prompt from being redisplayed to the user.
- Parameters:
session
- GeckoSession instance requesting the permission.perm
- AnGeckoSession.PermissionDelegate.ContentPermission
describing the permission being requested and its current status.- Returns:
- A
GeckoResult
resolving to one ofVALUE_*
, determining the response to the permission request and updating the permissions for this site.
-
onMediaPermissionRequest
@UiThread default void onMediaPermissionRequest(@NonNull GeckoSession session, @NonNull String uri, @Nullable GeckoSession.PermissionDelegate.MediaSource[] video, @Nullable GeckoSession.PermissionDelegate.MediaSource[] audio, @NonNull GeckoSession.PermissionDelegate.MediaCallback callback) Request content media permissions, including request for which video and/or audio source to use.Media permissions will still be requested if the associated device permissions have been denied if there are video or audio sources in that category that can still be accessed. It is the responsibility of consumers to ensure that media permission requests are not displayed in this case.
- Parameters:
session
- GeckoSession instance requesting the permission.uri
- The URI of the content requesting the permission.video
- List of video sources, or null if not requesting video.audio
- List of audio sources, or null if not requesting audio.callback
- Callback interface.
-