mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] No issue: Fix onConfigurationChange crashes in Debug build
This commit is contained in:
parent
56c98b57b8
commit
79ab29eff2
@ -431,8 +431,17 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
|
||||
// https://issuetracker.google.com/issues/143570309#comment3
|
||||
applicationContext.resources.configuration.uiMode = config.uiMode
|
||||
|
||||
// random StrictMode onDiskRead violation even when Fenix is not running in the background.
|
||||
components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
|
||||
if (isMainProcess()) {
|
||||
// We can only do this on the main process as resetAfter will access components.core, which
|
||||
// will initialize the engine and create an additional GeckoRuntime from the Gecko
|
||||
// child process, causing a crash.
|
||||
|
||||
// There's a strict mode violation in A-Cs LocaleAwareApplication which
|
||||
// reads from shared prefs: https://github.com/mozilla-mobile/android-components/issues/8816
|
||||
components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
|
||||
super.onConfigurationChanged(config)
|
||||
}
|
||||
} else {
|
||||
super.onConfigurationChanged(config)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user