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

Commit 32950481 authored by Hasib Prince's avatar Hasib Prince
Browse files

Merge branch '6201-fix_notification' into 'main'

fixed: notification of update completed

See merge request !246
parents 39692d8b 403cbcdd
Loading
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -136,8 +136,12 @@ class InstallAppWorker @AssistedInject constructor(
    ) {
        if (isItUpdateWork) {
            fusedDownload?.let {
                val actualFusedDownload = databaseRepository.getDownloadById(it.id)
                if (actualFusedDownload?.status == Status.INSTALLED) {
                val packageStatus = packageManagerModule.getPackageStatus(
                    fusedDownload.packageName,
                    fusedDownload.versionCode
                )

                if (packageStatus == Status.INSTALLED) {
                    UpdatesDao.addSuccessfullyUpdatedApp(it)
                }

@@ -152,7 +156,12 @@ class InstallAppWorker @AssistedInject constructor(
    private suspend fun isUpdateCompleted(): Boolean {
        val downloadListWithoutAnyIssue =
            databaseRepository.getDownloadList()
                .filter { !listOf(Status.INSTALLATION_ISSUE, Status.PURCHASE_NEEDED).contains(it.status) }
                .filter {
                    !listOf(
                        Status.INSTALLATION_ISSUE,
                        Status.PURCHASE_NEEDED
                    ).contains(it.status)
                }

        return UpdatesDao.successfulUpdatedApps.isNotEmpty() && downloadListWithoutAnyIssue.isEmpty()
    }