closes #24366: reset strict mode after locale read

upstream-sync
MatthewTighe 2 years ago committed by mergify[bot]
parent 846751009d
commit c1d2a9fb70

@ -21,7 +21,7 @@ import org.mozilla.fenix.ext.components
import org.mozilla.fenix.helpers.HomeActivityTestRule
// BEFORE INCREASING THESE VALUES, PLEASE CONSULT WITH THE PERF TEAM.
private const val EXPECTED_SUPPRESSION_COUNT = 19
private const val EXPECTED_SUPPRESSION_COUNT = 20
@Suppress("TopLevelPropertyNaming") // it's silly this would have a different naming convention b/c no const
private val EXPECTED_RUNBLOCKING_RANGE = 0..1 // CI has +1 counts compared to local runs: increment these together
private const val EXPECTED_RECYCLER_VIEW_CONSTRAINT_LAYOUT_CHILDREN = 4

@ -5,8 +5,10 @@
package org.mozilla.fenix
import android.content.Context
import android.os.StrictMode
import mozilla.components.support.locale.LocaleManager
import mozilla.components.support.locale.LocaleManager.getSystemDefault
import org.mozilla.fenix.ext.components
/**
* A single source for setting feature flags that are mostly based on build type.
@ -91,9 +93,11 @@ object FeatureFlags {
* Enables themed wallpapers feature.
*/
fun isThemedWallpapersFeatureEnabled(context: Context): Boolean {
val langTag = LocaleManager.getCurrentLocale(context)
?.toLanguageTag() ?: getSystemDefault().toLanguageTag()
return listOf("en-US", "es-US").contains(langTag)
return context.components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
val langTag = LocaleManager.getCurrentLocale(context)
?.toLanguageTag() ?: getSystemDefault().toLanguageTag()
listOf("en-US", "es-US").contains(langTag)
}
}
/**

Loading…
Cancel
Save