diff --git a/app/src/main/kotlin/com/looker/droidify/MainApplication.kt b/app/src/main/kotlin/com/looker/droidify/MainApplication.kt index f77a1a62c..ded43cb70 100644 --- a/app/src/main/kotlin/com/looker/droidify/MainApplication.kt +++ b/app/src/main/kotlin/com/looker/droidify/MainApplication.kt @@ -122,16 +122,12 @@ class MainApplication : Application(), ImageLoaderFactory, Configuration.Provide addAction(Intent.ACTION_PACKAGE_REMOVED) addDataScheme("package") }) - appScope.launch { - val installedItems = - packageManager.getInstalledPackagesCompat() - ?.map { it.toInstalledItem() } - ?: run { - cancel() - return@launch - } - Database.InstalledAdapter.putAll(installedItems) - } + val installedItems = + packageManager.getInstalledPackagesCompat() + ?.map { it.toInstalledItem() } + ?: return + Database.InstalledAdapter.putAll(installedItems) + } private fun checkLanguage() { diff --git a/app/src/main/kotlin/com/looker/droidify/database/Database.kt b/app/src/main/kotlin/com/looker/droidify/database/Database.kt index dcf3d5728..eae067394 100644 --- a/app/src/main/kotlin/com/looker/droidify/database/Database.kt +++ b/app/src/main/kotlin/com/looker/droidify/database/Database.kt @@ -709,7 +709,7 @@ object Database { fun put(installedItem: InstalledItem) = put(installedItem, true) - suspend fun putAll(installedItems: List) = withContext(Dispatchers.IO) { + fun putAll(installedItems: List) { db.transaction { db.delete(Schema.Installed.name, null, null) installedItems.forEach { put(it, false) }