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

Commit 5108c9ad authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

refactor: SystemAppsUpdateRepository.getSystemAppInfo()

parent f4b0b21b
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -132,14 +132,13 @@ class SystemAppsUpdatesRepository @Inject constructor(
        val projectId = systemAppProject.projectId

        return if (systemAppProject.dependsOnAndroidVersion) {
            val latestRelease = getLatestReleaseByAndroidVersion(projectId)
            if (latestRelease == null) {
                null //todo replace by an error code to avoid to check for nullity in calling method ?
            val latestReleaseTag = getLatestReleaseByAndroidVersion(projectId)?.tagName

            if (latestReleaseTag == null) {
                null
            } else {
                val releaseTag = latestRelease.tagName
                systemAppDefinitionApi.getSystemAppUpdateInfoByTag(projectId, releaseTag, releaseType)
                systemAppDefinitionApi.getSystemAppUpdateInfoByTag(projectId, latestReleaseTag, releaseType)
            }

        } else {
            systemAppDefinitionApi.getLatestSystemAppUpdateInfo(projectId, releaseType)
        }