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

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

ignore installation_issue to show update end notification

parent f22b180d
Loading
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ class InstallAppWorker @AssistedInject constructor(
                fusedManagerRepository.installationIssue(it)
            }
        } finally {
            if (isItUpdateWork && databaseRepository.getDownloadList().isEmpty()) { // show notification for ended update
            if (isItUpdateWork && isUpdateCompleted()) { // show notification for ended update
                showNotificationOnUpdateEnded()
            }

@@ -131,6 +131,15 @@ class InstallAppWorker @AssistedInject constructor(
        }
    }

    private suspend fun isUpdateCompleted(): Boolean {
        val downloadListWithoutAnyIssue =
            databaseRepository.getDownloadList()
                .filter { !listOf(Status.INSTALLATION_ISSUE, Status.PURCHASE_NEEDED).contains(it.status) }

        return downloadListWithoutAnyIssue.isEmpty()
    }


    private fun showNotificationOnUpdateEnded() {
        val date = Date(System.currentTimeMillis())
        val dateFormat =