2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-15 18:12:54 +00:00

For #13368 - Ignores strict mode for LeanplumMetricsService

This commit is contained in:
Jeff Boek 2020-08-25 14:25:37 -07:00 committed by Jonathan Almeida
parent c8e97546b2
commit c58fa028bf

View File

@ -7,6 +7,7 @@ package org.mozilla.fenix.components.metrics
import android.app.Application import android.app.Application
import android.content.Context.MODE_PRIVATE import android.content.Context.MODE_PRIVATE
import android.net.Uri import android.net.Uri
import android.os.StrictMode
import android.util.Log import android.util.Log
import androidx.annotation.VisibleForTesting import androidx.annotation.VisibleForTesting
import com.leanplum.Leanplum import com.leanplum.Leanplum
@ -22,6 +23,7 @@ import kotlinx.coroutines.withContext
import mozilla.components.support.locale.LocaleManager import mozilla.components.support.locale.LocaleManager
import org.mozilla.fenix.BuildConfig import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.components.metrics.MozillaProductDetector.MozillaProducts import org.mozilla.fenix.components.metrics.MozillaProductDetector.MozillaProducts
import org.mozilla.fenix.ext.resetPoliciesAfter
import org.mozilla.fenix.ext.settings import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.home.intent.DeepLinkIntentProcessor import org.mozilla.fenix.home.intent.DeepLinkIntentProcessor
import java.util.Locale import java.util.Locale
@ -81,7 +83,9 @@ class LeanplumMetricsService(
override val type = MetricServiceType.Marketing override val type = MetricServiceType.Marketing
private val token = Token(LeanplumId, LeanplumToken) private val token = Token(LeanplumId, LeanplumToken)
private val preferences = application.getSharedPreferences(PREFERENCE_NAME, MODE_PRIVATE) private val preferences = StrictMode.allowThreadDiskReads().resetPoliciesAfter {
application.getSharedPreferences(PREFERENCE_NAME, MODE_PRIVATE)
}
@VisibleForTesting @VisibleForTesting
internal val deviceId by lazy { internal val deviceId by lazy {