Loading app/src/main/java/foundation/e/apps/data/gitlab/SystemAppsUpdatesRepository.kt +12 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,14 @@ class SystemAppsUpdatesRepository @Inject constructor( if (getUpdatableSystemApps().isNotEmpty() && !forceRefresh) { return@handleNetworkResult } val response = updatableSystemAppsApi.getUpdatableSystemApps() val systemName = getFullSystemName() val endPoint = if (systemName.contains("beta") || systemName.contains("rc")) { UpdatableSystemAppsApi.EndPoint.ENDPOINT_TEST } else UpdatableSystemAppsApi.EndPoint.ENDPOINT_RELEASE val response = updatableSystemAppsApi.getUpdatableSystemApps(endPoint) if (response.isSuccessful && !response.body().isNullOrEmpty()) { systemAppProjectList.clear() response.body()?.let { systemAppProjectList.addAll(it) } Loading Loading @@ -103,6 +110,10 @@ class SystemAppsUpdatesRepository @Inject constructor( } } private fun getFullSystemName(): String { return SystemInfoProvider.getSystemProperty(SystemInfoProvider.KEY_LINEAGE_VERSION) ?: "" } private fun getSdkLevel(): Int { return Build.VERSION.SDK_INT } Loading app/src/main/java/foundation/e/apps/data/gitlab/UpdatableSystemAppsApi.kt +14 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ package foundation.e.apps.data.gitlab import foundation.e.apps.data.gitlab.models.SystemAppProject import retrofit2.Response import retrofit2.http.GET import retrofit2.http.Path interface UpdatableSystemAppsApi { Loading @@ -28,7 +29,18 @@ interface UpdatableSystemAppsApi { "https://gitlab.e.foundation/e/os/system-apps-update-info/-/raw/main/" } @GET("updatable_system_apps.json?inline=false") suspend fun getUpdatableSystemApps(): Response<List<SystemAppProject>> enum class EndPoint(private val value: String) { ENDPOINT_RELEASE("updatable_system_apps.json"), ENDPOINT_TEST("updatable_system_apps_test.json"), ; override fun toString(): String { return value } } @GET("{endPoint}?inline=false") suspend fun getUpdatableSystemApps( @Path("endPoint") endPoint: EndPoint = EndPoint.ENDPOINT_RELEASE ): Response<List<SystemAppProject>> } Loading
app/src/main/java/foundation/e/apps/data/gitlab/SystemAppsUpdatesRepository.kt +12 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,14 @@ class SystemAppsUpdatesRepository @Inject constructor( if (getUpdatableSystemApps().isNotEmpty() && !forceRefresh) { return@handleNetworkResult } val response = updatableSystemAppsApi.getUpdatableSystemApps() val systemName = getFullSystemName() val endPoint = if (systemName.contains("beta") || systemName.contains("rc")) { UpdatableSystemAppsApi.EndPoint.ENDPOINT_TEST } else UpdatableSystemAppsApi.EndPoint.ENDPOINT_RELEASE val response = updatableSystemAppsApi.getUpdatableSystemApps(endPoint) if (response.isSuccessful && !response.body().isNullOrEmpty()) { systemAppProjectList.clear() response.body()?.let { systemAppProjectList.addAll(it) } Loading Loading @@ -103,6 +110,10 @@ class SystemAppsUpdatesRepository @Inject constructor( } } private fun getFullSystemName(): String { return SystemInfoProvider.getSystemProperty(SystemInfoProvider.KEY_LINEAGE_VERSION) ?: "" } private fun getSdkLevel(): Int { return Build.VERSION.SDK_INT } Loading
app/src/main/java/foundation/e/apps/data/gitlab/UpdatableSystemAppsApi.kt +14 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ package foundation.e.apps.data.gitlab import foundation.e.apps.data.gitlab.models.SystemAppProject import retrofit2.Response import retrofit2.http.GET import retrofit2.http.Path interface UpdatableSystemAppsApi { Loading @@ -28,7 +29,18 @@ interface UpdatableSystemAppsApi { "https://gitlab.e.foundation/e/os/system-apps-update-info/-/raw/main/" } @GET("updatable_system_apps.json?inline=false") suspend fun getUpdatableSystemApps(): Response<List<SystemAppProject>> enum class EndPoint(private val value: String) { ENDPOINT_RELEASE("updatable_system_apps.json"), ENDPOINT_TEST("updatable_system_apps_test.json"), ; override fun toString(): String { return value } } @GET("{endPoint}?inline=false") suspend fun getUpdatableSystemApps( @Path("endPoint") endPoint: EndPoint = EndPoint.ENDPOINT_RELEASE ): Response<List<SystemAppProject>> }