NetworkType


enum NetworkType : Enum


An enumeration of various network types that can be used as Constraints for work.

Summary

Enum Values

CONNECTED

Any working network connection is required for this work.

METERED

A metered network connection is required for this work.

NOT_REQUIRED

A network is not required for this work.

NOT_ROAMING

A non-roaming network connection is required for this work.

TEMPORARILY_UNMETERED

A temporarily unmetered Network.

UNMETERED

An unmetered network connection is required for this work.

Public functions

NetworkType
valueOf(value: String)

Returns the enum constant of this type with the specified name.

Array<NetworkType>

Returns an array containing the constants of this enum type, in the order they're declared.

Public properties

EnumEntries<NetworkType>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Enum Values

CONNECTED

val NetworkType.CONNECTEDNetworkType

Any working network connection is required for this work.

METERED

val NetworkType.METEREDNetworkType

A metered network connection is required for this work.

NOT_REQUIRED

val NetworkType.NOT_REQUIREDNetworkType

A network is not required for this work.

NOT_ROAMING

val NetworkType.NOT_ROAMINGNetworkType

A non-roaming network connection is required for this work.

TEMPORARILY_UNMETERED

val NetworkType.TEMPORARILY_UNMETEREDNetworkType

A temporarily unmetered Network. This capability will be set for networks that are generally metered, but are currently unmetered.

Note: This capability can be changed at any time. When it is removed, ListenableWorkers are responsible for stopping any data transfer that should not occur on a metered network.

UNMETERED

val NetworkType.UNMETEREDNetworkType

An unmetered network connection is required for this work.

Public functions

valueOf

Added in 1.0.0
fun valueOf(value: String): NetworkType

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

Added in 1.0.0
fun values(): Array<NetworkType>

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

Public properties

entries

val entriesEnumEntries<NetworkType>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

This method may be used to iterate over the enum entries.