|
|
|
@ -24,10 +24,13 @@ import mozilla.components.concept.engine.EngineSession.TrackingProtectionPolicy
|
|
|
|
|
import mozilla.components.concept.engine.EngineSession.TrackingProtectionPolicy.Companion.SAFE_BROWSING_ALL
|
|
|
|
|
import mozilla.components.concept.engine.mediaquery.PreferredColorScheme
|
|
|
|
|
import mozilla.components.concept.fetch.Client
|
|
|
|
|
import mozilla.components.feature.media.MediaFeature
|
|
|
|
|
import mozilla.components.feature.media.RecordingDevicesNotificationFeature
|
|
|
|
|
import mozilla.components.feature.media.state.MediaStateMachine
|
|
|
|
|
import mozilla.components.feature.session.HistoryDelegate
|
|
|
|
|
import mozilla.components.lib.crash.handler.CrashHandlerService
|
|
|
|
|
import org.mozilla.fenix.AppRequestInterceptor
|
|
|
|
|
import org.mozilla.fenix.FeatureFlags
|
|
|
|
|
import org.mozilla.fenix.ext.components
|
|
|
|
|
import org.mozilla.fenix.test.Mockable
|
|
|
|
|
import org.mozilla.fenix.utils.Settings
|
|
|
|
@ -78,7 +81,7 @@ class Core(private val context: Context) {
|
|
|
|
|
historyTrackingDelegate = HistoryDelegate(historyStorage),
|
|
|
|
|
preferredColorScheme = getPreferredColorScheme(),
|
|
|
|
|
automaticFontSizeAdjustment = Settings.getInstance(context).shouldUseAutoSize,
|
|
|
|
|
suspendMediaWhenInactive = true
|
|
|
|
|
suspendMediaWhenInactive = !FeatureFlags.mediaIntegration
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
GeckoEngine(context, defaultSettings, runtime)
|
|
|
|
@ -125,6 +128,14 @@ class Core(private val context: Context) {
|
|
|
|
|
.whenGoingToBackground()
|
|
|
|
|
.whenSessionsChange()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (FeatureFlags.mediaIntegration) {
|
|
|
|
|
MediaStateMachine.start(sessionManager)
|
|
|
|
|
|
|
|
|
|
// Enable media features like showing an ongoing notification with media controls when
|
|
|
|
|
// media in web content is playing.
|
|
|
|
|
MediaFeature(context).enable()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|