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

Commit 981d234d authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

new Origin and new Source

parent e6413cd6
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 -> FilterLevel.NONE
            !isRestricted(application) -> FilterLevel.NONE
            authData == null -> FilterLevel.UNKNOWN // cannot determine for gplay app
            !isApplicationVisible(application) -> FilterLevel.DATA
+6 −3
Original line number Diff line number Diff line
@@ -112,9 +112,12 @@ data class Application(

    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 -> 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 -> {
                // 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 -> {
                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 -> ("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,
}
Loading