VpnStateMonitor

interface VpnStateMonitor

Types

Link copied to clipboard
data class AlwaysOnState(val enabled: Boolean, val lockedDown: Boolean)
Link copied to clipboard
sealed class VpnRunningState
Link copied to clipboard
data class VpnState(val state: VpnStateMonitor.VpnRunningState, val stopReason: VpnStateMonitor.VpnStopReason? = null, val alwaysOnState: VpnStateMonitor.AlwaysOnState = DEFAULT)
Link copied to clipboard
sealed class VpnStopReason

Functions

Link copied to clipboard
abstract fun getStateFlow(vpnFeature: VpnFeature): Flow<VpnStateMonitor.VpnState>

Returns a flow of VPN changes for the given vpnFeature It follows the following truth table:

Link copied to clipboard
abstract suspend fun isAlwaysOnEnabled(): Boolean
Link copied to clipboard
abstract suspend fun vpnLastDisabledByAndroid(): Boolean