[fenix] closes https://github.com/mozilla-mobile/fenix/issues/24289: reset strict mode after WallpaperManager construction

pull/600/head
MatthewTighe 2 years ago committed by mergify[bot]
parent ff598e99fa
commit 2352d2b129

@ -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

@ -7,6 +7,7 @@ package org.mozilla.fenix.components
import android.app.Application
import android.content.Context
import android.content.Intent
import android.os.StrictMode
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import androidx.core.net.toUri
@ -144,15 +145,6 @@ class Components(private val context: Context) {
AddonManager(core.store, core.engine, addonCollectionProvider, addonUpdater)
}
val wallpaperManager by lazyMonitored {
WallpaperManager(
settings,
WallpaperDownloader(context, core.client),
WallpaperFileManager(context.filesDir),
analytics.crashReporter,
)
}
val analytics by lazyMonitored { Analytics(context) }
val publicSuffixList by lazyMonitored { PublicSuffixList(context) }
val clipboardHandler by lazyMonitored { ClipboardHandler(context) }
@ -162,6 +154,17 @@ class Components(private val context: Context) {
val wifiConnectionMonitor by lazyMonitored { WifiConnectionMonitor(context as Application) }
val strictMode by lazyMonitored { StrictModeManager(Config, this) }
val wallpaperManager by lazyMonitored {
strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
WallpaperManager(
settings,
WallpaperDownloader(context, core.client),
WallpaperFileManager(context.filesDir),
analytics.crashReporter,
)
}
}
val settings by lazyMonitored { Settings(context) }
val reviewPromptController by lazyMonitored {

Loading…
Cancel
Save