let initialize plugins before accessing db
This commit is contained in:
parent
005e429e40
commit
6711276732
1 changed files with 12 additions and 12 deletions
|
@ -95,18 +95,6 @@ class MainApp : DaggerApplication() {
|
|||
gitRemote = null
|
||||
commitHash = null
|
||||
}
|
||||
disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).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)
|
||||
|
@ -126,6 +114,18 @@ class MainApp : DaggerApplication() {
|
|||
pluginStore.plugins = plugins
|
||||
configBuilder.initialize()
|
||||
|
||||
disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).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()
|
||||
WorkManager.getInstance(this).enqueueUniquePeriodicWork(
|
||||
"KeepAlive",
|
||||
ExistingPeriodicWorkPolicy.REPLACE,
|
||||
|
|
Loading…
Reference in a new issue