2019-01-24 22:07:52 +01:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2019-01-23 22:39:53 +01:00
|
|
|
package org.mozilla.fenix
|
|
|
|
|
|
|
|
import android.app.Application
|
|
|
|
import org.mozilla.fenix.components.Components
|
|
|
|
|
|
|
|
class FenixApplication : Application() {
|
|
|
|
val components by lazy { Components(this) }
|
2019-01-29 17:42:10 +01:00
|
|
|
|
|
|
|
override fun onCreate() {
|
|
|
|
super.onCreate()
|
|
|
|
|
|
|
|
setupCrashReporting()
|
|
|
|
}
|
|
|
|
|
|
|
|
private fun setupCrashReporting() {
|
|
|
|
@Suppress("ConstantConditionIf")
|
|
|
|
if (!BuildConfig.CRASH_REPORTING || BuildConfig.BUILD_TYPE != "release") {
|
|
|
|
// Only enable crash reporting if this is a release build and if crash reporting was explicitly enabled
|
|
|
|
// via a Gradle command line flag.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
components
|
|
|
|
.analytics
|
|
|
|
.crashReporter
|
|
|
|
.install(this)
|
|
|
|
}
|
2019-01-23 22:39:53 +01:00
|
|
|
}
|