ConnectivityStatus

sealed interface ConnectivityStatus(source)

Connectivity state reported by a ConnectivityMonitor.

ConnectivityMonitor.isConnected is false only for Disconnected; Unknown and MonitorError count as connected so that the UI never shows a false "offline" alert.

Inheritors

Types

Link copied to clipboard
data class Connected(val transport: Transport = Transport.Unknown, val isMetered: Boolean? = null, val isConstrained: Boolean? = null, val isValidated: Boolean? = null) : ConnectivityStatus

The internet is reachable under the configured ValidationPolicy.

Link copied to clipboard
data class Disconnected(val reason: DisconnectReason = DisconnectReason.NoNetwork) : ConnectivityStatus

The internet is not reachable.

Link copied to clipboard
data class MonitorError(val cause: Throwable) : ConnectivityStatus

The platform monitor failed. Only used with FailurePolicy.Error.

Link copied to clipboard

No reading yet. Only used with InitialState.Unknown.

Properties

Link copied to clipboard