diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index 8d86c7a6e9..3ea9524625 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -32,7 +32,7 @@ import info.nightscout.androidaps.receivers.NetworkChangeReceiver import info.nightscout.androidaps.receivers.TimeDateOrTZChangeReceiver import info.nightscout.androidaps.utils.ActivityMonitor import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.locale.LocaleHelper.update +import info.nightscout.androidaps.utils.locale.LocaleHelper import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.androidaps.utils.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable @@ -69,7 +69,7 @@ class MainApp : DaggerApplication() { aapsLogger.debug("onCreate") RxDogTag.install() setRxErrorHandler() - update(this) + LocaleHelper.update(this) var gitRemote: String? = BuildConfig.REMOTE var commitHash: String? = BuildConfig.HEAD @@ -78,7 +78,17 @@ class MainApp : DaggerApplication() { commitHash = null } disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe() - disposable += repository.runTransaction(InsertIfNewByTimestampTherapyEventTransaction(timestamp = dateUtil.now(), type = TherapyEvent.Type.NOTE, note = getString(info.nightscout.androidaps.core.R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL, glucoseUnit = TherapyEvent.GlucoseUnit.MGDL)).subscribe() + if (sp.getBoolean(R.string.key_ns_logappstartedevent, config.APS)) + disposable += repository + .runTransaction( + InsertIfNewByTimestampTherapyEventTransaction( + timestamp = dateUtil.now(), + type = TherapyEvent.Type.NOTE, + note = getString(info.nightscout.androidaps.core.R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL, + glucoseUnit = TherapyEvent.GlucoseUnit.MGDL + ) + ) + .subscribe() disposable += compatDBHelper.dbChangeDisposable() registerActivityLifecycleCallbacks(activityMonitor) JodaTimeAndroid.init(this)