GeofenceManager

open class GeofenceManager(context: Context, policyProvider: () -> GeofencePolicy, profileProvider: (String) -> PolicyProfile?, auditTrail: AuditTrail?, clock: Clock = Clock.systemUTC())

Manages geofence monitoring and policy profile switching.

Security (BSI SYS.3.2.2.A8): Uses Android Geofencing API with configurable responsiveness to balance accuracy and battery life.

Privacy (GDPR Art. 5): No location data is persisted or transmitted. Only region membership state is tracked for policy switching.

Since

0.4.0

Constructors

Link copied to clipboard
constructor(context: Context, policyProvider: () -> GeofencePolicy, profileProvider: (String) -> PolicyProfile?, auditTrail: AuditTrail?, clock: Clock = Clock.systemUTC())

Functions

Link copied to clipboard

Add a geofence transition listener.

Link copied to clipboard

Get all currently active region IDs.

Link copied to clipboard

Get current policy profile.

Link copied to clipboard

Get current policy profile name.

Link copied to clipboard

Get current active region (highest priority if multiple).

Link copied to clipboard
fun isInRegion(regionId: String): Boolean

Check if currently inside a specific region.

Link copied to clipboard

Check if monitoring is active.

Link copied to clipboard

Remove a geofence transition listener.

Link copied to clipboard
@RequiresPermission(value = "android.permission.ACCESS_FINE_LOCATION")
suspend fun startMonitoring(): GeofenceStartResult

Start geofence monitoring.

Link copied to clipboard
suspend fun stopMonitoring()

Stop geofence monitoring.