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

Commit 2c84d563 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Rename Fused to Application

parent 39768a50
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import retrofit2.Response

typealias GplaySearchResult = ResultSupreme<Pair<List<FusedApp>, Set<SearchBundle.SubBundle>>>

interface FusedApi {
interface ApplicationApi {
    companion object {
        const val APP_TYPE_ANY = "any"
        const val APP_TYPE_OPEN = "open"
+5 −6
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import dagger.hilt.android.qualifiers.ApplicationContext
import foundation.e.apps.R
import foundation.e.apps.data.ResultSupreme
import foundation.e.apps.data.cleanapk.CleanApkDownloadInfoFetcher
import foundation.e.apps.data.cleanapk.CleanApkRetrofit
import foundation.e.apps.data.cleanapk.data.app.Application
import foundation.e.apps.data.cleanapk.data.categories.Categories
import foundation.e.apps.data.cleanapk.data.home.Home
@@ -49,9 +48,9 @@ import foundation.e.apps.data.enums.Source
import foundation.e.apps.data.enums.Status
import foundation.e.apps.data.enums.Type
import foundation.e.apps.data.enums.isUnFiltered
import foundation.e.apps.data.fused.FusedApi.Companion.APP_TYPE_ANY
import foundation.e.apps.data.fused.FusedApi.Companion.APP_TYPE_OPEN
import foundation.e.apps.data.fused.FusedApi.Companion.APP_TYPE_PWA
import foundation.e.apps.data.fused.ApplicationApi.Companion.APP_TYPE_ANY
import foundation.e.apps.data.fused.ApplicationApi.Companion.APP_TYPE_OPEN
import foundation.e.apps.data.fused.ApplicationApi.Companion.APP_TYPE_PWA
import foundation.e.apps.data.fused.data.FusedApp
import foundation.e.apps.data.fused.data.FusedCategory
import foundation.e.apps.data.fused.data.FusedHome
@@ -82,7 +81,7 @@ import javax.inject.Singleton
typealias FusedHomeDeferred = Deferred<ResultSupreme<List<FusedHome>>>

@Singleton
class FusedApiImpl @Inject constructor(
class ApplicationApiImpl @Inject constructor(
    private val pkgManagerModule: PkgManagerModule,
    private val pwaManagerModule: PWAManagerModule,
    private val preferenceManagerModule: PreferenceManagerModule,
@@ -90,7 +89,7 @@ class FusedApiImpl @Inject constructor(
    @Named("cleanApkAppsRepository") private val cleanApkAppsRepository: CleanApkRepository,
    @Named("cleanApkPWARepository") private val cleanApkPWARepository: CleanApkRepository,
    @ApplicationContext private val context: Context
) : FusedApi {
) : ApplicationApi {

    companion object {
        private const val CATEGORY_TITLE_REPLACEABLE_CONJUNCTION = "&"
+22 −22
Original line number Diff line number Diff line
@@ -37,14 +37,14 @@ import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class FusedAPIRepository @Inject constructor(private val fusedAPIImpl: FusedApi) {
class FusedAPIRepository @Inject constructor(private val applicationAPIImpl: ApplicationApi) {

    suspend fun getHomeScreenData(authData: AuthData): LiveData<ResultSupreme<List<FusedHome>>> {
        return fusedAPIImpl.getHomeScreenData(authData)
        return applicationAPIImpl.getHomeScreenData(authData)
    }

    fun getApplicationCategoryPreference(): List<String> {
        return fusedAPIImpl.getApplicationCategoryPreference()
        return applicationAPIImpl.getApplicationCategoryPreference()
    }

    suspend fun getApplicationDetails(
@@ -52,11 +52,11 @@ class FusedAPIRepository @Inject constructor(private val fusedAPIImpl: FusedApi)
        authData: AuthData,
        origin: Origin
    ): Pair<List<FusedApp>, ResultStatus> {
        return fusedAPIImpl.getApplicationDetails(packageNameList, authData, origin)
        return applicationAPIImpl.getApplicationDetails(packageNameList, authData, origin)
    }

    suspend fun getAppFilterLevel(fusedApp: FusedApp, authData: AuthData?): FilterLevel {
        return fusedAPIImpl.getAppFilterLevel(fusedApp, authData)
        return applicationAPIImpl.getAppFilterLevel(fusedApp, authData)
    }

    suspend fun getApplicationDetails(
@@ -65,25 +65,25 @@ class FusedAPIRepository @Inject constructor(private val fusedAPIImpl: FusedApi)
        authData: AuthData,
        origin: Origin
    ): Pair<FusedApp, ResultStatus> {
        return fusedAPIImpl.getApplicationDetails(id, packageName, authData, origin)
        return applicationAPIImpl.getApplicationDetails(id, packageName, authData, origin)
    }

    suspend fun getCleanapkAppDetails(packageName: String): Pair<FusedApp, ResultStatus> {
        return fusedAPIImpl.getCleanapkAppDetails(packageName)
        return applicationAPIImpl.getCleanapkAppDetails(packageName)
    }

    suspend fun updateFusedDownloadWithDownloadingInfo(
        origin: Origin,
        fusedDownload: FusedDownload
    ) {
        fusedAPIImpl.updateFusedDownloadWithDownloadingInfo(
        applicationAPIImpl.updateFusedDownloadWithDownloadingInfo(
            origin,
            fusedDownload
        )
    }

    suspend fun getOSSDownloadInfo(id: String, version: String? = null) =
        fusedAPIImpl.getOSSDownloadInfo(id, version)
        applicationAPIImpl.getOSSDownloadInfo(id, version)

    suspend fun getOnDemandModule(
        packageName: String,
@@ -91,31 +91,31 @@ class FusedAPIRepository @Inject constructor(private val fusedAPIImpl: FusedApi)
        versionCode: Int,
        offerType: Int
    ): String? {
        return fusedAPIImpl.getOnDemandModule(packageName, moduleName, versionCode, offerType)
        return applicationAPIImpl.getOnDemandModule(packageName, moduleName, versionCode, offerType)
    }

    suspend fun getCategoriesList(
        type: CategoryType,
    ): Triple<List<FusedCategory>, String, ResultStatus> {
        return fusedAPIImpl.getCategoriesList(type)
        return applicationAPIImpl.getCategoriesList(type)
    }

    suspend fun getSearchSuggestions(query: String): List<SearchSuggestEntry> {
        return fusedAPIImpl.getSearchSuggestions(query)
        return applicationAPIImpl.getSearchSuggestions(query)
    }

    suspend fun getCleanApkSearchResults(
        query: String,
        authData: AuthData
    ): ResultSupreme<Pair<List<FusedApp>, Boolean>> {
        return fusedAPIImpl.getCleanApkSearchResults(query, authData)
        return applicationAPIImpl.getCleanApkSearchResults(query, authData)
    }

    suspend fun getGplaySearchResults(
        query: String,
        nextPageSubBundle: Set<SearchBundle.SubBundle>?
    ): GplaySearchResult {
        return fusedAPIImpl.getGplaySearchResult(query, nextPageSubBundle)
        return applicationAPIImpl.getGplaySearchResult(query, nextPageSubBundle)
    }

    suspend fun getAppsListBasedOnCategory(
@@ -125,28 +125,28 @@ class FusedAPIRepository @Inject constructor(private val fusedAPIImpl: FusedApi)
        source: Source
    ): ResultSupreme<Pair<List<FusedApp>, String>> {
        return when (source) {
            Source.OPEN -> fusedAPIImpl.getOpenSourceApps(category)
            Source.PWA -> fusedAPIImpl.getPWAApps(category)
            else -> fusedAPIImpl.getGplayAppsByCategory(authData, category, pageUrl)
            Source.OPEN -> applicationAPIImpl.getOpenSourceApps(category)
            Source.PWA -> applicationAPIImpl.getPWAApps(category)
            else -> applicationAPIImpl.getGplayAppsByCategory(authData, category, pageUrl)
        }
    }

    fun getFusedAppInstallationStatus(fusedApp: FusedApp): Status {
        return fusedAPIImpl.getFusedAppInstallationStatus(fusedApp)
        return applicationAPIImpl.getFusedAppInstallationStatus(fusedApp)
    }

    fun isHomeDataUpdated(
        newHomeData: List<FusedHome>,
        oldHomeData: List<FusedHome>
    ) = fusedAPIImpl.isHomeDataUpdated(newHomeData, oldHomeData)
    ) = applicationAPIImpl.isHomeDataUpdated(newHomeData, oldHomeData)

    fun isAnyFusedAppUpdated(
        newFusedApps: List<FusedApp>,
        oldFusedApps: List<FusedApp>
    ) = fusedAPIImpl.isAnyFusedAppUpdated(newFusedApps, oldFusedApps)
    ) = applicationAPIImpl.isAnyFusedAppUpdated(newFusedApps, oldFusedApps)

    fun isAnyAppInstallStatusChanged(currentList: List<FusedApp>) =
        fusedAPIImpl.isAnyAppInstallStatusChanged(currentList)
        applicationAPIImpl.isAnyAppInstallStatusChanged(currentList)

    fun isOpenSourceSelected() = fusedAPIImpl.isOpenSourceSelected()
    fun isOpenSourceSelected() = applicationAPIImpl.isOpenSourceSelected()
}
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ import foundation.e.apps.data.enums.isUnFiltered
import foundation.e.apps.data.faultyApps.FaultyAppRepository
import foundation.e.apps.data.fdroid.FdroidRepository
import foundation.e.apps.data.fused.FusedAPIRepository
import foundation.e.apps.data.fused.FusedApi.Companion.APP_TYPE_ANY
import foundation.e.apps.data.fused.ApplicationApi.Companion.APP_TYPE_ANY
import foundation.e.apps.data.fused.data.FusedApp
import foundation.e.apps.data.preference.PreferenceManagerModule
import foundation.e.apps.install.pkg.PkgManagerModule
+3 −3
Original line number Diff line number Diff line
@@ -10,8 +10,8 @@ import foundation.e.apps.data.exodus.repositories.PrivacyScoreRepository
import foundation.e.apps.data.exodus.repositories.PrivacyScoreRepositoryImpl
import foundation.e.apps.data.fdroid.FdroidRepository
import foundation.e.apps.data.fdroid.IFdroidRepository
import foundation.e.apps.data.fused.FusedApi
import foundation.e.apps.data.fused.FusedApiImpl
import foundation.e.apps.data.fused.ApplicationApi
import foundation.e.apps.data.fused.ApplicationApiImpl
import foundation.e.apps.data.fusedDownload.FusedManagerImpl
import foundation.e.apps.data.fusedDownload.IFusedManager
import javax.inject.Singleton
@@ -33,7 +33,7 @@ interface RepositoryModule {

    @Singleton
    @Binds
    fun getFusedApi(fusedApiImpl: FusedApiImpl): FusedApi
    fun getFusedApi(fusedApiImpl: ApplicationApiImpl): ApplicationApi

    @Singleton
    @Binds
Loading