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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCallback interface for notifying the result of a permission request.static classRepresents a content permission -- including the type of permission, the present value of the permission, the URL the permission pertains to, and other information.static interfaceCallback interface for notifying the result of a media permission request, including which media source(s) to use.static classDefines the set of media source categories and types used for media capture. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intPermission for allowing autoplay of audible video.static final intPermission for allowing autoplay of inaudible (silent) video.static final intPermission for using the notifications API.static final intPermission for using the geolocation API.static final intPermission for local device (localhost) accessstatic final intPermission for local network accessstatic final intPermission for accessing system media keys used to decode DRM media.static final intPermission for using the storage API.static final intPermission for third party frames to access first party cookies.static final intPermission for trackers to operate on the page -- disables all tracking protection features for a given site.static final intPermission for using the WebXR API. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidonAndroidPermissionsRequest(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 voidonMediaPermissionRequest(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:
-
PERMISSION_LOCAL_DEVICE_ACCESS
static final int PERMISSION_LOCAL_DEVICE_ACCESSPermission for local device (localhost) access- See Also:
-
PERMISSION_LOCAL_NETWORK_ACCESS
static final int PERMISSION_LOCAL_NETWORK_ACCESSPermission for local network access- 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.ContentPermissiondescribing the permission being requested and its current status.- Returns:
- A
GeckoResultresolving 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.
-