File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app-tracking-protection/vpn-impl/src/main/java/com/duckduckgo/mobile/android/vpn/feature Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import android.content.SharedPreferences.OnSharedPreferenceChangeListener
21
21
import androidx.core.content.edit
22
22
import com.duckduckgo.anvil.annotations.ContributesRemoteFeature
23
23
import com.duckduckgo.app.di.AppCoroutineScope
24
+ import com.duckduckgo.common.utils.DefaultDispatcherProvider
24
25
import com.duckduckgo.common.utils.DispatcherProvider
25
26
import com.duckduckgo.data.store.api.SharedPreferencesProvider
26
27
import com.duckduckgo.di.scopes.AppScope
@@ -182,11 +183,12 @@ class AppTpRemoteFeaturesStore @Inject constructor(
182
183
183
184
@ContributesMultibinding(AppScope ::class )
184
185
class AppTpTDSPixelsPlugin @Inject constructor(private val inventory : FeatureTogglesInventory ) : MetricsPixelPlugin {
186
+ private val dispatchers: DispatcherProvider = DefaultDispatcherProvider ()
185
187
186
- override suspend fun getMetrics (): List <MetricsPixel > {
187
- val activeToggle = inventory.activeAppTpTdsFlag() ? : return emptyList()
188
+ override suspend fun getMetrics (): List <MetricsPixel > = withContext(dispatchers.io()) {
189
+ val activeToggle = inventory.activeAppTpTdsFlag() ? : return @withContext emptyList()
188
190
189
- return listOf (
191
+ return @withContext listOf (
190
192
MetricsPixel (
191
193
metric = " selectedRemoveTrackingProtectionFeature" ,
192
194
value = " 1" ,
You can’t perform that action at this time.
0 commit comments