Commit c58fa028 authored by Jeff Boek's avatar Jeff Boek Committed by Jonathan Almeida
Browse files

For #13368 - Ignores strict mode for LeanplumMetricsService

parent c8e97546
...@@ -7,6 +7,7 @@ package org.mozilla.fenix.components.metrics ...@@ -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 ...@@ -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( ...@@ -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 {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment