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

Commit f1632123 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

add system apps update in other apps update.

parent aab76402
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -128,7 +128,11 @@ class UpdatesManagerImpl @Inject constructor(
        }

        val nonFaultyUpdateList = faultyAppRepository.removeFaultyApps(updateList)
        return Pair(nonFaultyUpdateList, status)

        val systemApps = getSystemUpdates(false).toMutableList()
        putAppLoungeAtLast(systemApps)

        return Pair(nonFaultyUpdateList + systemApps, status)
    }

    suspend fun getUpdatesOSS(): Pair<List<Application>, ResultStatus> {
@@ -162,7 +166,11 @@ class UpdatesManagerImpl @Inject constructor(
        }

        val nonFaultyUpdateList = faultyAppRepository.removeFaultyApps(updateList)
        return Pair(nonFaultyUpdateList, status)

        val systemApps = getSystemUpdates(false).toMutableList()
        putAppLoungeAtLast(systemApps)

        return Pair(nonFaultyUpdateList + systemApps, status)
    }

    suspend fun getSystemUpdates(onlySelf: Boolean = false): List<Application> {
@@ -193,6 +201,13 @@ class UpdatesManagerImpl @Inject constructor(
        return updateList
    }

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

    private fun getSdkLevel(): Int {
        return Build.VERSION.SDK_INT
    }