From fb9e402f62afdedfebf8715d03c27aa2fc1a4210 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Mon, 17 Jul 2023 08:02:06 +0200 Subject: [PATCH 1/3] 7127: fix new installed app doesn't show up in AdvancedPrivacy until reboot --- .../data/repositories/AppListsRepository.kt | 8 ++++---- 1 file 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 0b951a8f..2d7651d1 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 } } } -- GitLab From fc17f49c395309b78f9efeebbec50c4af884e839 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Mon, 17 Jul 2023 09:50:08 +0000 Subject: [PATCH 2/3] chore: fix release build trigger. --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d7374aa1..c2b14f8d 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 -- GitLab From 9b6f780de691d3fa7a49160a41c91d5c54b82fd8 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Mon, 17 Jul 2023 09:50:28 +0000 Subject: [PATCH 3/3] chore: fix release build trigger. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c2b14f8d..8aa50067 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -99,11 +99,11 @@ build-e-release: variables: MAPBOX_KEY: $MAPBOX_KEY_PROD when: always - - if: '$CI_COMMIT_REF_PROTECTED == "true" + - if: '$CI_COMMIT_REF_PROTECTED == "true"' variables: MAPBOX_KEY: $MAPBOX_KEY_PROD when: manual - + artifacts: paths: - app/build/outputs/apk -- GitLab