From 26ea8900a200d3b4c3accc730c03928b966af63d Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 16 Oct 2019 14:48:22 +0300 Subject: [PATCH] App: only init the data store once per application. We were accidentally initialising it once every time we were trying to access it. --- app/src/main/java/com/etesync/syncadapter/App.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/com/etesync/syncadapter/App.kt b/app/src/main/java/com/etesync/syncadapter/App.kt index 16508870..3e444471 100644 --- a/app/src/main/java/com/etesync/syncadapter/App.kt +++ b/app/src/main/java/com/etesync/syncadapter/App.kt @@ -51,8 +51,7 @@ class App : Application() { * `@Provides @Singleton`. */ // override onUpgrade to handle migrating to a new version - val data: MyEntityDataStore - get() = initDataStore() + val data = initDataStore() fun initDataStore(): MyEntityDataStore { val source = MyDatabaseSource(this, Models.DEFAULT, 4)