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

Commit 1997035d authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

Merge branch '8124-update_system_apps_p1' into '8124-main'

feat: (Issue 8124) New Origin and new Source for gitlab apps

See merge request !475
parents bb7c4407 84cfa8e0
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ class ApplicationDataManager @Inject constructor(
            application.package_name.isBlank() -> FilterLevel.UNKNOWN
            !application.isFree && application.price.isBlank() -> FilterLevel.UI
            application.origin == Origin.CLEANAPK -> FilterLevel.NONE
            application.origin == Origin.GITLAB_RELEASES -> FilterLevel.NONE
            !isRestricted(application) -> FilterLevel.NONE
            authData == null -> FilterLevel.UNKNOWN // cannot determine for gplay app
            !isApplicationVisible(application) -> FilterLevel.DATA
+7 −3
Original line number Diff line number Diff line
@@ -110,11 +110,15 @@ data class Application(
        this.type = if (this.is_pwa) PWA else NATIVE
    }

    // TODO: Make this logic separate from data layer (https://gitlab.e.foundation/e/os/backlog/-/issues/2371)
    fun updateSource(context: Context) {
        this.apply {
            source = if (origin != Origin.CLEANAPK) ""
            else if (is_pwa) context.getString(R.string.pwa)
            else context.getString(R.string.open_source)
            source = when {
                origin == Origin.GITLAB_RELEASES -> context.getString(R.string.system_app)
                origin == Origin.GPLAY -> ""
                is_pwa -> context.getString(R.string.pwa)
                else -> context.getString(R.string.open_source)
            }
        }
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -68,6 +68,10 @@ class DownloadInfoApiImpl @Inject constructor(
            Origin.GPLAY -> {
                updateDownloadInfoFromGplay(appInstall, list)
            }

            Origin.GITLAB_RELEASES -> {
                // TODO
            }
        }

        appInstall.downloadURLList = list
+5 −0
Original line number Diff line number Diff line
@@ -120,6 +120,10 @@ class HomeApiImpl @Inject constructor(
            Source.PWA -> handleNetworkResult {
                handleCleanApkHomes(priorList, SearchApi.APP_TYPE_PWA)
            }

            Source.GITLAB_RELEASES -> {
                ResultSupreme.Error(message = "Gitlab source not allowed")
            }
        }

        setHomeErrorMessage(result.getResultStatus(), source)
@@ -223,6 +227,7 @@ class HomeApiImpl @Inject constructor(
        if (apiStatus != ResultStatus.OK) {
            apiStatus.message = when (source) {
                Source.GPLAY -> ("GPlay home loading error\n" + apiStatus.message).trim()
                Source.GITLAB_RELEASES -> ("Gitlab home not allowed\n" + apiStatus.message).trim()
                Source.OPEN -> ("Open Source home loading error\n" + apiStatus.message).trim()
                Source.PWA -> ("PWA home loading error\n" + apiStatus.message).trim()
            }
+2 −1
Original line number Diff line number Diff line
@@ -20,5 +20,6 @@ package foundation.e.apps.data.enums

enum class Origin {
    CLEANAPK,
    GPLAY
    GPLAY,
    GITLAB_RELEASES,
}
Loading