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

Commit 140ebece authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

rearrangeAppLoungeAtLast

parent 605bbd1a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ class UpdatesManagerImpl @Inject constructor(
        val nonFaultyUpdateList = faultyAppRepository.removeFaultyApps(updateList)

        addSystemAppsAtFirst(updateList, nonFaultyUpdateList, systemApps)
        rearrangeAppLoungeAtLast(updateList)

        return Pair(updateList, status)
    }
@@ -167,6 +168,7 @@ class UpdatesManagerImpl @Inject constructor(
        val nonFaultyUpdateList = faultyAppRepository.removeFaultyApps(updateList)

        addSystemAppsAtFirst(updateList, nonFaultyUpdateList, systemApps)
        rearrangeAppLoungeAtLast(updateList)

        return Pair(updateList, status)
    }
@@ -194,6 +196,14 @@ class UpdatesManagerImpl @Inject constructor(
        updateList.addAll(nonFaultyApps)
    }

    private fun rearrangeAppLoungeAtLast(updateList: MutableList<Application>) {
        val appLoungeItem = updateList.find {
            it.isSystemApp && it.package_name == context.packageName
        } ?: return
        updateList.remove(appLoungeItem)
        updateList.add(appLoungeItem)
    }

    /**
     * Lists apps directly updatable by App Lounge from the Open Source category.
     * (This includes apps installed by F-Droid client app, if used by the user;