Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2e5f0ae authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

Merge branch '7127-fetch_app_list_on_new_install' into 'release-1.13'

7127: fix new installed app doesn't show up in AdvancedPrivacy until reboot

See merge request !140
parents c58614d7 fb9e402f
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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
                }
            }
        }