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

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

Merge branch '5713-empty_downloadlist' into 'main'

FusedDownload validated before starting installing

See merge request !173
parents 901faef9 1054f0d4
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -83,4 +83,7 @@ class FusedManagerRepository @Inject constructor(
    suspend fun updateFusedDownload(fusedDownload: FusedDownload) {
        fusedManagerImpl.updateFusedDownload(fusedDownload)
    }

    fun validateFusedDownload(fusedDownload: FusedDownload) =
        fusedDownload.packageName.isNotEmpty() && fusedDownload.downloadURLList.isNotEmpty()
}
+6 −0
Original line number Diff line number Diff line
@@ -97,6 +97,12 @@ class InstallAppWorker @AssistedInject constructor(
                        "Installing ${it.name}"
                    )
                )

                if (!fusedManagerRepository.validateFusedDownload(fusedDownload)) {
                    fusedManagerRepository.installationIssue(it)
                    return@let
                }

                startAppInstallationProcess(it)
                mutex.lock()
            }