PermissionOrchestrator

Sequential permission-request state machine over a PermissionsProvider. Walks a fixed sequence one permission at a time: each step is skipped if already granted, otherwise requestCurrent asks for it, records the PermissionResult, and advances. Pure orchestration over the platform provider, no Android / iOS types, so it is fully covered by JVM unit tests with a fake provider. The UI observes state and calls requestCurrent from a button; runAll auto-walks the whole sequence.

Constructors

Link copied to clipboard
constructor(provider: PermissionsProvider, sequence: List<AppPermission>)

Properties

Link copied to clipboard
val state: StateFlow<PermissionFlowState>

Functions

Link copied to clipboard

Prompt for the current permission, record the result, and advance. No-op once complete.

Link copied to clipboard
suspend fun runAll()

Walk the entire sequence: skip granted ones, request the rest, stop at the end.

Link copied to clipboard
suspend fun skipAlreadyGranted()

Advance past any leading permissions that are already granted, without prompting.