diff options
author | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2023-07-25 11:31:55 +0000 |
---|---|---|
committer | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2023-07-25 11:31:55 +0000 |
commit | 466b3947268bb9e053da492e376f94af58b6a9c5 (patch) | |
tree | 43ce1f4205326414e5611190b026c8905e746487 /app/src | |
parent | c588ee2ea1f025732b1d5da506e1b5952ba24f3f (diff) | |
parent | 25741b44b574edb2cee6ef5299f562bb87a94c26 (diff) |
Merge branch 'release-1.13' into 'main'
7127: fix new installed app doesn't show up in AdvancedPrivacy until reboot
See merge request e/os/advanced-privacy!142
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/foundation/e/advancedprivacy/data/repositories/AppListsRepository.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/src/main/java/foundation/e/advancedprivacy/data/repositories/AppListsRepository.kt b/app/src/main/java/foundation/e/advancedprivacy/data/repositories/AppListsRepository.kt index 0b951a8..2d7651d 100644 --- a/app/src/main/java/foundation/e/advancedprivacy/data/repositories/AppListsRepository.kt +++ b/app/src/main/java/foundation/e/advancedprivacy/data/repositories/AppListsRepository.kt @@ -138,16 +138,16 @@ class AppListsRepository( private var lastFetchApps = 0 private var refreshAppJob: Job? = null private fun refreshAppDescriptions(fetchMissingIcons: Boolean = true, force: Boolean = false): Job? { - if (refreshAppJob == null) { + if (refreshAppJob == null || refreshAppJob?.isCompleted == true) { refreshAppJob = coroutineScope.launch(Dispatchers.IO) { - if (force || context.packageManager.getChangedPackages(lastFetchApps) != null) { + if (appsByUid.isEmpty() || appsByAPId.isEmpty() || + force || context.packageManager.getChangedPackages(lastFetchApps) != null + ) { fetchAppDescriptions(fetchMissingIcons = fetchMissingIcons) if (fetchMissingIcons) { lastFetchApps = context.packageManager.getChangedPackages(lastFetchApps) ?.sequenceNumber ?: lastFetchApps } - - refreshAppJob = null } } } |