PendingPredicate

@ObjCName(swiftName = "PendingPredicate")
sealed interface PendingPredicate

A single condition currently preventing a scheduled task from running.

Surfaced on ScheduledTask.pendingPredicates — operators reading BackgroundTaskManager.scheduled can see why a task isn't running yet, not just its ScheduledTask.State. Multiple predicates can apply at once (e.g. unmet network + in-backoff).

Best-effort per platform — some predicates are observable from one platform's state model but not another's. The list is empty when no predicate is actively blocking dispatch.

SKIE renders this as a Swift enum for exhaustive switch via onEnum(of:).

Inheritors

Types

Link copied to clipboard
data class NetworkRequired(val requirement: NetworkRequirement) : PendingPredicate

The configured WorkConstraints.networkRequired is not currently satisfied. The library will gate worker entry on reachability up to the per-platform timeout (see DeferralReason.ReachabilityTimeout).

Link copied to clipboard

The configured WorkConstraints.requiresCharging is set and the device is not currently on external power.

Link copied to clipboard

The configured WorkConstraints.requiresDeviceIdle is set and the device is not currently idle (not in a Doze maintenance window).

Link copied to clipboard
data class WaitingForBackoff(val until: Instant?) : PendingPredicate

The task is in a backoff window — the library is delaying the next attempt to honour the configured BackoffPolicy. until is the library's best-effort estimate of when the backoff will release.

Link copied to clipboard

The OS scheduler has accepted the request but its earliest-begin window has not yet elapsed. On iOS this maps to BGTaskRequest.earliestBeginDate; on Android, to WorkInfo.nextScheduleTimeMillis when set in the future.