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

Commit 975127d0 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

issue_5413_2 [WIP]: getCategoriesListOSS() now shows both open source as well as PWAs

parent 3a9aebf9
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -211,10 +211,23 @@ class FusedAPIImpl @Inject constructor(
     */
    suspend fun getCategoriesListOSS(type: Category.Type): Triple<List<FusedCategory>, String, ResultStatus> {
        val categoriesList = mutableListOf<FusedCategory>()
        val preferredApplicationType = preferenceManagerModule.preferredApplicationType()
        return handleCleanApkCategories(preferredApplicationType, categoriesList, type).run {
            Triple(categoriesList, "open", this)
        val status = runCodeBlockWithTimeout({
            getOpenSourceCategories()?.run {
                categoriesList.addAll(
                    getFusedCategoryBasedOnCategoryType(
                        this, type, AppTag.OpenSource(context.getString(R.string.open_source))
                    )
                )
            }
            getPWAsCategories()?.run {
                categoriesList.addAll(
                    getFusedCategoryBasedOnCategoryType(
                        this, type, AppTag.PWA(context.getString(R.string.pwa))
                    )
                )
            }
        })
        return Triple(categoriesList, "open", status)
    }

    /**