Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

Constraints

public final class Constraints
extends Object

java.lang.Object
   ↳ androidx.work.Constraints


The constraints that can be applied to one WorkRequest.

Summary

Nested classes

class Constraints.Builder

Builder for Constraints class. 

Fields

public static final Constraints NONE

Public constructors

Constraints(Constraints other)

Public methods

boolean equals(Object o)
ContentUriTriggers getContentUriTriggers()
NetworkType getRequiredNetworkType()
boolean hasContentUriTriggers()
int hashCode()
boolean requiresBatteryNotLow()
boolean requiresCharging()
boolean requiresDeviceIdle()
boolean requiresStorageNotLow()
void setContentUriTriggers(ContentUriTriggers mContentUriTriggers)
void setRequiredNetworkType(NetworkType requiredNetworkType)
void setRequiresBatteryNotLow(boolean requiresBatteryNotLow)
void setRequiresCharging(boolean requiresCharging)
void setRequiresDeviceIdle(boolean requiresDeviceIdle)
void setRequiresStorageNotLow(boolean requiresStorageNotLow)

Inherited methods

Fields

NONE

public static final Constraints NONE

Public constructors

Constraints

public Constraints (Constraints other)

Parameters
other Constraints

Public methods

equals

public boolean equals (Object o)

Parameters
o Object

Returns
boolean

getContentUriTriggers

public ContentUriTriggers getContentUriTriggers ()

Returns
ContentUriTriggers

getRequiredNetworkType

public NetworkType getRequiredNetworkType ()

Returns
NetworkType

hasContentUriTriggers

public boolean hasContentUriTriggers ()

Returns
boolean true if ContentUriTriggers is not empty

hashCode

public int hashCode ()

Returns
int

requiresBatteryNotLow

public boolean requiresBatteryNotLow ()

Returns
boolean If the constraints require battery not low status.

requiresCharging

public boolean requiresCharging ()

Returns
boolean If the constraints require charging.

requiresDeviceIdle

public boolean requiresDeviceIdle ()

Returns
boolean If the constraints require device idle.

requiresStorageNotLow

public boolean requiresStorageNotLow ()

Returns
boolean If the constraints require storage not low status.

setContentUriTriggers

public void setContentUriTriggers (ContentUriTriggers mContentUriTriggers)

Parameters
mContentUriTriggers ContentUriTriggers

setRequiredNetworkType

public void setRequiredNetworkType (NetworkType requiredNetworkType)

Parameters
requiredNetworkType NetworkType

setRequiresBatteryNotLow

public void setRequiresBatteryNotLow (boolean requiresBatteryNotLow)

Parameters
requiresBatteryNotLow boolean

setRequiresCharging

public void setRequiresCharging (boolean requiresCharging)

Parameters
requiresCharging boolean

setRequiresDeviceIdle

public void setRequiresDeviceIdle (boolean requiresDeviceIdle)

Parameters
requiresDeviceIdle boolean

setRequiresStorageNotLow

public void setRequiresStorageNotLow (boolean requiresStorageNotLow)

Parameters
requiresStorageNotLow boolean