parent
56ff4e4797
commit
9269a53b21
|
@ -398,7 +398,11 @@ open class FenixApplication : LocaleAwareApplication() {
|
|||
// are not triggered when also using createConfigurationContext like we do in LocaleManager
|
||||
// https://issuetracker.google.com/issues/143570309#comment3
|
||||
applicationContext.resources.configuration.uiMode = config.uiMode
|
||||
super.onConfigurationChanged(config)
|
||||
|
||||
// random StrictMode onDiskRead violation even when Fenix is not running in the background.
|
||||
StrictMode.allowThreadDiskReads().resetPoliciesAfter {
|
||||
super.onConfigurationChanged(config)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -7,6 +7,7 @@ package org.mozilla.fenix
|
|||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.StrictMode
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import kotlinx.coroutines.MainScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -15,6 +16,7 @@ import org.mozilla.fenix.components.IntentProcessorType
|
|||
import org.mozilla.fenix.components.getType
|
||||
import org.mozilla.fenix.components.metrics.Event
|
||||
import org.mozilla.fenix.ext.components
|
||||
import org.mozilla.fenix.ext.resetPoliciesAfter
|
||||
import org.mozilla.fenix.ext.settings
|
||||
import org.mozilla.fenix.perf.StartupTimeline
|
||||
import org.mozilla.fenix.shortcut.NewTabShortcutIntentProcessor
|
||||
|
@ -26,7 +28,10 @@ class IntentReceiverActivity : Activity() {
|
|||
|
||||
@VisibleForTesting
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// StrictMode violation on certain devices such as Samsung
|
||||
StrictMode.allowThreadDiskReads().resetPoliciesAfter {
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
MainScope().launch {
|
||||
// The intent property is nullable, but the rest of the code below
|
||||
|
@ -57,8 +62,10 @@ class IntentReceiverActivity : Activity() {
|
|||
intentProcessorType.shouldOpenToBrowser(intent)
|
||||
)
|
||||
}
|
||||
|
||||
startActivity(intent)
|
||||
// StrictMode violation on certain devices such as Samsung
|
||||
StrictMode.allowThreadDiskReads().resetPoliciesAfter {
|
||||
startActivity(intent)
|
||||
}
|
||||
finish() // must finish() after starting the other activity
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ package org.mozilla.fenix.browser
|
|||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.os.StrictMode
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
@ -40,6 +41,7 @@ import org.mozilla.fenix.ext.nav
|
|||
import org.mozilla.fenix.ext.navigateSafe
|
||||
import org.mozilla.fenix.ext.requireComponents
|
||||
import org.mozilla.fenix.ext.settings
|
||||
import org.mozilla.fenix.ext.resetPoliciesAfter
|
||||
import org.mozilla.fenix.shortcut.FirstTimePwaObserver
|
||||
import org.mozilla.fenix.trackingprotection.TrackingProtectionOverlay
|
||||
|
||||
|
@ -90,22 +92,24 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
|
|||
browserToolbarView.view.addPageAction(readerModeAction)
|
||||
|
||||
readerViewFeature.set(
|
||||
feature = ReaderViewFeature(
|
||||
context,
|
||||
components.core.engine,
|
||||
components.core.store,
|
||||
view.readerViewControlsBar
|
||||
) { available, active ->
|
||||
if (available) {
|
||||
components.analytics.metrics.track(Event.ReaderModeAvailable)
|
||||
}
|
||||
feature = StrictMode.allowThreadDiskReads().resetPoliciesAfter {
|
||||
ReaderViewFeature(
|
||||
context,
|
||||
components.core.engine,
|
||||
components.core.store,
|
||||
view.readerViewControlsBar
|
||||
) { available, active ->
|
||||
if (available) {
|
||||
components.analytics.metrics.track(Event.ReaderModeAvailable)
|
||||
}
|
||||
|
||||
readerModeAvailable = available
|
||||
readerModeAction.setSelected(active)
|
||||
readerModeAvailable = available
|
||||
readerModeAction.setSelected(active)
|
||||
|
||||
runIfFragmentIsAttached {
|
||||
browserToolbarView.view.invalidateActions()
|
||||
browserToolbarView.toolbarIntegration.invalidateMenu()
|
||||
runIfFragmentIsAttached {
|
||||
browserToolbarView.view.invalidateActions()
|
||||
browserToolbarView.toolbarIntegration.invalidateMenu()
|
||||
}
|
||||
}
|
||||
},
|
||||
owner = this,
|
||||
|
|
Loading…
Reference in New Issue