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

Commit 7cdf58ba authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

reduce return statements

parent fea022a5
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -76,20 +76,18 @@ class SystemAppsUpdatesRepository @Inject constructor(
        val projectId =
            systemAppProjectList.find { it.packageName == packageName }?.projectId ?: return null

        val response = systemAppDefinitionApi.getSystemAppUpdateInfo(projectId, releaseType)
        if (!response.isSuccessful) {
            Timber.e("Failed to fetch system app update definition for: $packageName, $releaseType")
            return null
        }

        val systemAppInfo = response.body() ?: return null
        val systemAppInfo =
            systemAppDefinitionApi.getSystemAppUpdateInfo(projectId, releaseType).body()

        if (isSystemAppBlacklisted(systemAppInfo, sdkLevel, device)) {
        return if (systemAppInfo == null) {
            Timber.e("Null app info for: $packageName")
            null
        } else if (isSystemAppBlacklisted(systemAppInfo, sdkLevel, device)) {
            Timber.e("Blacklisted system app: $packageName, $systemAppInfo")
            return null
            null
        } else {
            systemAppInfo.toApplication()
        }

        return systemAppInfo.toApplication()
    }

    private fun getSdkLevel(): Int {