|
|
@ -9,6 +9,7 @@ import android.app.Application
|
|
|
|
import android.os.Build
|
|
|
|
import android.os.Build
|
|
|
|
import android.os.Build.VERSION.SDK_INT
|
|
|
|
import android.os.Build.VERSION.SDK_INT
|
|
|
|
import android.os.StrictMode
|
|
|
|
import android.os.StrictMode
|
|
|
|
|
|
|
|
import androidx.annotation.CallSuper
|
|
|
|
import androidx.appcompat.app.AppCompatDelegate
|
|
|
|
import androidx.appcompat.app.AppCompatDelegate
|
|
|
|
import androidx.core.content.getSystemService
|
|
|
|
import androidx.core.content.getSystemService
|
|
|
|
import io.reactivex.plugins.RxJavaPlugins
|
|
|
|
import io.reactivex.plugins.RxJavaPlugins
|
|
|
@ -51,17 +52,7 @@ open class FenixApplication : Application() {
|
|
|
|
override fun onCreate() {
|
|
|
|
override fun onCreate() {
|
|
|
|
super.onCreate()
|
|
|
|
super.onCreate()
|
|
|
|
|
|
|
|
|
|
|
|
setupApplication()
|
|
|
|
setupInAllProcesses()
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
open fun setupApplication() {
|
|
|
|
|
|
|
|
setupCrashReporting()
|
|
|
|
|
|
|
|
setDayNightTheme()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setupMegazord()
|
|
|
|
|
|
|
|
setupLogging()
|
|
|
|
|
|
|
|
registerRxExceptionHandling()
|
|
|
|
|
|
|
|
enableStrictMode()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isMainProcess()) {
|
|
|
|
if (!isMainProcess()) {
|
|
|
|
// If this is not the main process then do not continue with the initialization here. Everything that
|
|
|
|
// If this is not the main process then do not continue with the initialization here. Everything that
|
|
|
@ -71,6 +62,30 @@ open class FenixApplication : Application() {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setupInMainProcessOnly()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@CallSuper
|
|
|
|
|
|
|
|
open fun setupInAllProcesses() {
|
|
|
|
|
|
|
|
setupCrashReporting()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// We want the log messages of all builds to go to Android logcat
|
|
|
|
|
|
|
|
Log.addSink(AndroidLogSink())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@CallSuper
|
|
|
|
|
|
|
|
open fun setupInMainProcessOnly() {
|
|
|
|
|
|
|
|
setupMegazord()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// We want rust logging to go through the log sinks.
|
|
|
|
|
|
|
|
// This has to happen after initializing the megazord.
|
|
|
|
|
|
|
|
RustLog.enable()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setDayNightTheme()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
registerRxExceptionHandling()
|
|
|
|
|
|
|
|
enableStrictMode()
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure the engine is initialized and ready to use.
|
|
|
|
// Make sure the engine is initialized and ready to use.
|
|
|
|
components.core.engine.warmUp()
|
|
|
|
components.core.engine.warmUp()
|
|
|
|
|
|
|
|
|
|
|
@ -138,14 +153,6 @@ open class FenixApplication : Application() {
|
|
|
|
// no-op, LeakCanary is disabled by default
|
|
|
|
// no-op, LeakCanary is disabled by default
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun setupLogging() {
|
|
|
|
|
|
|
|
// We want the log messages of all builds to go to Android logcat
|
|
|
|
|
|
|
|
Log.addSink(AndroidLogSink())
|
|
|
|
|
|
|
|
// We want rust logging to go through the log sinks.
|
|
|
|
|
|
|
|
// This has to happen after initializing the megazord.
|
|
|
|
|
|
|
|
RustLog.enable()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun loadExperiments(): Deferred<Boolean> {
|
|
|
|
private fun loadExperiments(): Deferred<Boolean> {
|
|
|
|
val experimentsFile = File(filesDir, EXPERIMENTS_JSON_FILENAME)
|
|
|
|
val experimentsFile = File(filesDir, EXPERIMENTS_JSON_FILENAME)
|
|
|
|
val experimentSource = KintoExperimentSource(
|
|
|
|
val experimentSource = KintoExperimentSource(
|
|
|
|