VpnFeaturesRegistry

Use this class to register features that required VPN access.

Registering a feature will cause the VPN to be enabled. Unregistering a feature will cause the VPN to be disabled IF no other feature is registered.

Functions

Link copied to clipboard
abstract suspend fun getRegisteredFeatures(): List<VpnFeature>
Link copied to clipboard
abstract suspend fun isAnyFeatureRegistered(): Boolean
Link copied to clipboard
abstract suspend fun isAnyFeatureRunning(): Boolean
Link copied to clipboard
abstract suspend fun isFeatureRegistered(feature: VpnFeature): Boolean
Link copied to clipboard
abstract suspend fun isFeatureRunning(feature: VpnFeature): Boolean
Link copied to clipboard
abstract suspend fun refreshFeature(feature: VpnFeature)

Refreshing the feature will cause the VPN to be stopped/restarted if it is enabled and the feature is already registered.

Link copied to clipboard
abstract suspend fun registerFeature(feature: VpnFeature)

Call this method to register a feature that requires VPN access. If the VPN is not enabled, it will be enabled.

Link copied to clipboard
abstract suspend fun unregisterFeature(feature: VpnFeature)

Call this method to unregister a feature that requires VPN access. If the VPN will be disabled if and only if this is the last registered feature.