Constraints.Builder

public static final class Constraints.Builder
extends Object

java.lang.Object
   ↳ androidx.work.Constraints.Builder


A Builder for a Constraints object.

Summary

Public constructors

Builder()

Public methods

Constraints.Builder addContentUriTrigger(Uri uri, boolean triggerForDescendants)

Sets whether the WorkRequest should run when a local content: Uri is updated.

Constraints build()

Generates the Constraints from this Builder.

Constraints.Builder setRequiredNetworkType(NetworkType networkType)

Sets whether device should have a particular NetworkType for the WorkRequest to run.

Constraints.Builder setRequiresBatteryNotLow(boolean requiresBatteryNotLow)

Sets whether device battery should be at an acceptable level for the WorkRequest to run.

Constraints.Builder setRequiresCharging(boolean requiresCharging)

Sets whether device should be charging for the WorkRequest to run.

Constraints.Builder setRequiresDeviceIdle(boolean requiresDeviceIdle)

Sets whether device should be idle for the WorkRequest to run.

Constraints.Builder setRequiresStorageNotLow(boolean requiresStorageNotLow)

Sets whether the device's available storage should be at an acceptable level for the WorkRequest to run.

Constraints.Builder setTriggerContentMaxDelay(Duration duration)

Sets the maximum delay that is allowed from the first time a content: Uri change is detected to the time when the WorkRequest is scheduled.

Constraints.Builder