Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
karlenDimla committed Apr 5, 2024
1 parent 2d198f4 commit af8b5f2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 120 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import android.content.Context
import android.net.ConnectivityManager
import android.net.NetworkCapabilities
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.mobile.android.app.tracking.AppTrackingProtection
import com.duckduckgo.networkprotection.api.NetworkProtectionState
import com.duckduckgo.mobile.android.vpn.VpnFeaturesRegistry
import com.squareup.anvil.annotations.ContributesBinding
import dagger.SingleInstanceIn
import javax.inject.Inject
Expand All @@ -30,13 +29,12 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
class RealExternalVpnDetector @Inject constructor(
private val context: Context,
private val appTrackingProtection: AppTrackingProtection,
private val networkProtectionState: NetworkProtectionState,
private val vpnFeaturesRegistry: VpnFeaturesRegistry,
) : ExternalVpnDetector {

override suspend fun isExternalVpnDetected(): Boolean {
// if we're the ones using the VPN, no VPN is detected
if (appTrackingProtection.isRunning() || networkProtectionState.isRunning()) return false
if (vpnFeaturesRegistry.isAnyFeatureRunning()) return false

return runCatching {
val connectivityManager = context.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
Expand Down

This file was deleted.

0 comments on commit af8b5f2

Please sign in to comment.