Fix: Apps uninstalled externaly when app is not running persists

This commit is contained in:
machiav3lli 2022-03-25 15:01:27 +01:00
parent bcf008578f
commit f39a1abf97
2 changed files with 4 additions and 0 deletions

View File

@ -66,6 +66,7 @@ class MainApplication : Application(), ImageLoaderFactory {
.getInstalledPackages(Android.PackageManager.signaturesFlag) .getInstalledPackages(Android.PackageManager.signaturesFlag)
.map { it.toInstalledItem() } .map { it.toInstalledItem() }
CoroutineScope(Dispatchers.Default).launch { CoroutineScope(Dispatchers.Default).launch {
db.installedDao.emptyTable()
db.installedDao.put(*installedItems.toTypedArray()) db.installedDao.put(*installedItems.toTypedArray())
} }
} }

View File

@ -280,6 +280,9 @@ interface InstalledDao : BaseDao<Installed> {
@Query("DELETE FROM memory_installed WHERE package_name = :packageName") @Query("DELETE FROM memory_installed WHERE package_name = :packageName")
fun delete(packageName: String) fun delete(packageName: String)
@Query("DELETE FROM memory_installed")
fun emptyTable()
} }
@Dao @Dao