diff --git a/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/autoexclude/AutoExcludePrompt.kt b/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/autoexclude/AutoExcludePrompt.kt index 54b5f5b85dab..5f1adc8708ba 100644 --- a/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/autoexclude/AutoExcludePrompt.kt +++ b/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/autoexclude/AutoExcludePrompt.kt @@ -18,7 +18,7 @@ package com.duckduckgo.networkprotection.impl.autoexclude import com.duckduckgo.di.scopes.ActivityScope import com.duckduckgo.networkprotection.impl.autoexclude.AutoExcludePrompt.Trigger -import com.duckduckgo.networkprotection.impl.autoexclude.AutoExcludePrompt.Trigger.NEW_FLAGGED_APP +import com.duckduckgo.networkprotection.impl.autoexclude.AutoExcludePrompt.Trigger.NEW_INCOMPATIBLE_APP_FOUND import com.duckduckgo.networkprotection.store.NetPExclusionListRepository import com.squareup.anvil.annotations.ContributesBinding import javax.inject.Inject @@ -27,7 +27,7 @@ interface AutoExcludePrompt { suspend fun getAppsForPrompt(trigger: Trigger): List enum class Trigger { - NEW_FLAGGED_APP, + NEW_INCOMPATIBLE_APP_FOUND, INCOMPATIBLE_APP_MANUALLY_EXCLUDED, } } @@ -38,7 +38,7 @@ class RealAutoExcludePrompt @Inject constructor( private val autoExcludeAppsRepository: AutoExcludeAppsRepository, ) : AutoExcludePrompt { override suspend fun getAppsForPrompt(trigger: Trigger): List { - return if (trigger == NEW_FLAGGED_APP) { + return if (trigger == NEW_INCOMPATIBLE_APP_FOUND) { getFlaggedAppsForPrompt().also { autoExcludeAppsRepository.markAppsAsShown(it) } diff --git a/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/management/NetworkProtectionManagementViewModel.kt b/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/management/NetworkProtectionManagementViewModel.kt index 4dc309b4b62a..2c1aa4e083e1 100644 --- a/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/management/NetworkProtectionManagementViewModel.kt +++ b/network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/management/NetworkProtectionManagementViewModel.kt @@ -45,7 +45,7 @@ import com.duckduckgo.networkprotection.api.NetworkProtectionState import com.duckduckgo.networkprotection.impl.NetPVpnFeature import com.duckduckgo.networkprotection.impl.VpnRemoteFeatures import com.duckduckgo.networkprotection.impl.autoexclude.AutoExcludePrompt -import com.duckduckgo.networkprotection.impl.autoexclude.AutoExcludePrompt.Trigger.NEW_FLAGGED_APP +import com.duckduckgo.networkprotection.impl.autoexclude.AutoExcludePrompt.Trigger.NEW_INCOMPATIBLE_APP_FOUND import com.duckduckgo.networkprotection.impl.autoexclude.VpnIncompatibleApp import com.duckduckgo.networkprotection.impl.configuration.WgTunnelConfig import com.duckduckgo.networkprotection.impl.configuration.asServerDetails @@ -194,7 +194,7 @@ class NetworkProtectionManagementViewModel @Inject constructor( if (networkProtectionState.isRunning() && !localConfig.autoExcludeBrokenApps().isEnabled() ) { - autoExcludePrompt.getAppsForPrompt(NEW_FLAGGED_APP).also { + autoExcludePrompt.getAppsForPrompt(NEW_INCOMPATIBLE_APP_FOUND).also { if (it.isNotEmpty()) { sendCommand(ShowAutoExcludeDialog(it)) } diff --git a/network-protection/network-protection-impl/src/test/java/com/duckduckgo/networkprotection/impl/autoexclude/RealAutoExcludePromptTest.kt b/network-protection/network-protection-impl/src/test/java/com/duckduckgo/networkprotection/impl/autoexclude/RealAutoExcludePromptTest.kt index 91f1a4ec71d3..838bbbb03657 100644 --- a/network-protection/network-protection-impl/src/test/java/com/duckduckgo/networkprotection/impl/autoexclude/RealAutoExcludePromptTest.kt +++ b/network-protection/network-protection-impl/src/test/java/com/duckduckgo/networkprotection/impl/autoexclude/RealAutoExcludePromptTest.kt @@ -1,6 +1,6 @@ package com.duckduckgo.networkprotection.impl.autoexclude -import com.duckduckgo.networkprotection.impl.autoexclude.AutoExcludePrompt.Trigger.NEW_FLAGGED_APP +import com.duckduckgo.networkprotection.impl.autoexclude.AutoExcludePrompt.Trigger.NEW_INCOMPATIBLE_APP_FOUND import com.duckduckgo.networkprotection.store.NetPExclusionListRepository import com.duckduckgo.networkprotection.store.db.NetPManuallyExcludedApp import kotlinx.coroutines.test.runTest @@ -44,7 +44,7 @@ class RealAutoExcludePromptTest { VpnIncompatibleApp("test2"), ), ) - val result = autoExcludePrompt.getAppsForPrompt(NEW_FLAGGED_APP) + val result = autoExcludePrompt.getAppsForPrompt(NEW_INCOMPATIBLE_APP_FOUND) assertTrue(result.contains(VpnIncompatibleApp("test1"))) assertFalse(result.contains(VpnIncompatibleApp("test2"))) @@ -60,7 +60,7 @@ class RealAutoExcludePromptTest { VpnIncompatibleApp("test2"), ), ) - val result = autoExcludePrompt.getAppsForPrompt(NEW_FLAGGED_APP) + val result = autoExcludePrompt.getAppsForPrompt(NEW_INCOMPATIBLE_APP_FOUND) assertTrue(result.contains(VpnIncompatibleApp("test1"))) assertTrue(result.contains(VpnIncompatibleApp("test2"))) @@ -71,7 +71,7 @@ class RealAutoExcludePromptTest { whenever(netPExclusionListRepository.getManualAppExclusionList()).thenReturn(emptyList()) whenever(autoExcludeAppsRepository.getAppsForAutoExcludePrompt()).thenReturn(emptyList()) - val result = autoExcludePrompt.getAppsForPrompt(NEW_FLAGGED_APP) + val result = autoExcludePrompt.getAppsForPrompt(NEW_INCOMPATIBLE_APP_FOUND) assertTrue(result.isEmpty()) }