LinuxPortalLocationPermissionRequester

Observes and requests permission through the XDG Location portal.

LinuxPortalLocationProvider delegates LocationProvider.permission and LocationProvider.requestPermission to an instance of this class. Use it directly when a custom provider needs the same portal permission behavior.

The portal has no permission-status query. Permission therefore remains LocationPermission.NotGranted with canRequest = null until a successful Location.Start response maps it to LocationPermission.Granted with LocationAccuracyAuthorization.Unknown. Denied and unavailable responses remain NotGranted with canRequest = null. A missing portal maps backendAvailability to LocationBackendAvailability.Unsupported.

Constructors

Link copied to clipboard
constructor(window: XdgPortalWindow? = null)

Properties

Link copied to clipboard

Whether the XDG Location portal is installed.

Link copied to clipboard
val status: StateFlow<LocationPermission>

Current foreground location permission.

Functions

Link copied to clipboard
open override fun close()

Cancels pending requests and closes the portal.

Link copied to clipboard

Starts a foreground permission request and returns immediately. The result is published to status.