diff options
author | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2023-07-25 11:31:54 +0000 |
---|---|---|
committer | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2023-07-25 11:31:54 +0000 |
commit | 25741b44b574edb2cee6ef5299f562bb87a94c26 (patch) | |
tree | 43ce1f4205326414e5611190b026c8905e746487 | |
parent | c588ee2ea1f025732b1d5da506e1b5952ba24f3f (diff) |
7127: fix new installed app doesn't show up in AdvancedPrivacy until reboot
-rw-r--r-- | .gitlab-ci.yml | 6 | ||||
-rw-r--r-- | app/src/main/java/foundation/e/advancedprivacy/data/repositories/AppListsRepository.kt | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d7374aa..8aa5006 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -99,7 +99,11 @@ build-e-release: variables: MAPBOX_KEY: $MAPBOX_KEY_PROD when: always - - when: never + - if: '$CI_COMMIT_REF_PROTECTED == "true"' + variables: + MAPBOX_KEY: $MAPBOX_KEY_PROD + when: manual + artifacts: paths: - app/build/outputs/apk 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 } } } |