This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.your.package | |
import android.content.Context | |
import androidx.lifecycle.MutableLiveData | |
class NetworkConnectionListener constructor(context: Context) : | |
MutableLiveData<NetworkState>() { | |
private val connectionMonitor = NetworkDetector.getInstance(context.applicationContext) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Suppress("Deprecation") | |
private class LegacyVPNDetector( | |
private val context: Context, | |
connectivityManager: ConnectivityManager | |
) : VPNDetector(connectivityManager) { | |
private val filter = IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION) | |
private val isVPNConnected: Boolean | |
get() = checkVPNConnectivity() |