public final class Constraints
extends Object


A specification of the requirements that need to be met before a WorkRequest can run. By default, WorkRequests do not have any requirements and can run immediately. By adding requirements, you can make sure that work only runs in certain situations - for example, when you have an unmetered network and are charging.


Nested classes

class Constraints.Builder

A Builder for a Constraints object. 


public static final Constraints NONE

Represents a Constraints object with no requirements.

Public constructors

Constraints(Constraints other)

Public methods

boolean equals(Object o)
NetworkType getRequiredNetworkType()
int hashCode()
boolean requiresBatteryNotLow()
boolean requiresCharging()
boolean requiresDeviceIdle()
boolean requiresStorageNotLow()

Inherited methods