Loading app/build.gradle +3 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,9 @@ android { lint { lintConfig file('lint.xml') } kotlin.sourceSets.all { languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn") } } kapt { Loading app/src/main/java/foundation/e/apps/MainActivity.kt +1 −2 Original line number Diff line number Diff line Loading @@ -304,8 +304,7 @@ class MainActivity : AppCompatActivity() { // TODO: move storage availability code to FileManager Class private fun isStorageAvailable(fusedDownload: FusedDownload): Boolean { var availableSpace = 0L availableSpace = calculateAvailableDiskSpace() val availableSpace = calculateAvailableDiskSpace() return availableSpace > fusedDownload.appSize + (500 * (1000 * 1000)) } Loading app/src/main/java/foundation/e/apps/api/DownloadManager.kt +0 −2 Original line number Diff line number Diff line Loading @@ -103,8 +103,6 @@ class DownloadManager @Inject constructor( downloadManager.query(downloadManagerQuery.setFilterById(downloadId)) .use { cursor -> if (cursor.moveToFirst()) { val id = cursor.getLong(cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_ID)) val status = cursor.getInt(cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_STATUS)) val totalSizeBytes = Loading app/src/main/java/foundation/e/apps/api/cleanapk/blockedApps/BlockedAppRepository.kt +4 −4 Original line number Diff line number Diff line Loading @@ -50,15 +50,15 @@ class BlockedAppRepository @Inject constructor( fun fetchUpdateOfAppWarningList() { downloadManager.downloadFileInCache( APP_WARNING_LIST_FILE_URL, fileName = "app-lounge-warning-list.json" ) { success, path -> fileName = WARNING_LIST_FILE_NAME ) { success, _ -> if (success) { parseBlockedAppDataFromFile(path) parseBlockedAppDataFromFile() } } } private fun parseBlockedAppDataFromFile(path: String) { private fun parseBlockedAppDataFromFile() { coroutineScope.launch { val outputPath = "$cacheDir/warning_list/" FileManager.moveFile("$cacheDir/", WARNING_LIST_FILE_NAME, outputPath) Loading app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt +3 −5 Original line number Diff line number Diff line Loading @@ -948,7 +948,7 @@ class FusedAPIImpl @Inject constructor( runCodeBlockWithTimeout({ val playResponse = gPlayAPIRepository.getCategoriesList(type, authData).map { app -> val category = app.transformToFusedCategory() updateCategoryDrawable(category, app) updateCategoryDrawable(category) category } categoryList.addAll(playResponse) Loading Loading @@ -1045,7 +1045,6 @@ class FusedAPIImpl @Inject constructor( private fun updateCategoryDrawable( category: FusedCategory, app: Category ) { category.drawable = getCategoryIconResource(getCategoryIconName(category)) Loading Loading @@ -1083,7 +1082,7 @@ class FusedAPIImpl @Inject constructor( tag: AppTag ): List<FusedCategory> { return categories.apps.map { category -> createFusedCategoryFromCategory(category, categories, Category.Type.APPLICATION, tag) createFusedCategoryFromCategory(category, categories, tag) } } Loading @@ -1092,14 +1091,13 @@ class FusedAPIImpl @Inject constructor( tag: AppTag ): List<FusedCategory> { return categories.games.map { category -> createFusedCategoryFromCategory(category, categories, Category.Type.GAME, tag) createFusedCategoryFromCategory(category, categories, tag) } } private fun createFusedCategoryFromCategory( category: String, categories: Categories, appType: Category.Type, tag: AppTag ): FusedCategory { return FusedCategory( Loading Loading
app/build.gradle +3 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,9 @@ android { lint { lintConfig file('lint.xml') } kotlin.sourceSets.all { languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn") } } kapt { Loading
app/src/main/java/foundation/e/apps/MainActivity.kt +1 −2 Original line number Diff line number Diff line Loading @@ -304,8 +304,7 @@ class MainActivity : AppCompatActivity() { // TODO: move storage availability code to FileManager Class private fun isStorageAvailable(fusedDownload: FusedDownload): Boolean { var availableSpace = 0L availableSpace = calculateAvailableDiskSpace() val availableSpace = calculateAvailableDiskSpace() return availableSpace > fusedDownload.appSize + (500 * (1000 * 1000)) } Loading
app/src/main/java/foundation/e/apps/api/DownloadManager.kt +0 −2 Original line number Diff line number Diff line Loading @@ -103,8 +103,6 @@ class DownloadManager @Inject constructor( downloadManager.query(downloadManagerQuery.setFilterById(downloadId)) .use { cursor -> if (cursor.moveToFirst()) { val id = cursor.getLong(cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_ID)) val status = cursor.getInt(cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_STATUS)) val totalSizeBytes = Loading
app/src/main/java/foundation/e/apps/api/cleanapk/blockedApps/BlockedAppRepository.kt +4 −4 Original line number Diff line number Diff line Loading @@ -50,15 +50,15 @@ class BlockedAppRepository @Inject constructor( fun fetchUpdateOfAppWarningList() { downloadManager.downloadFileInCache( APP_WARNING_LIST_FILE_URL, fileName = "app-lounge-warning-list.json" ) { success, path -> fileName = WARNING_LIST_FILE_NAME ) { success, _ -> if (success) { parseBlockedAppDataFromFile(path) parseBlockedAppDataFromFile() } } } private fun parseBlockedAppDataFromFile(path: String) { private fun parseBlockedAppDataFromFile() { coroutineScope.launch { val outputPath = "$cacheDir/warning_list/" FileManager.moveFile("$cacheDir/", WARNING_LIST_FILE_NAME, outputPath) Loading
app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt +3 −5 Original line number Diff line number Diff line Loading @@ -948,7 +948,7 @@ class FusedAPIImpl @Inject constructor( runCodeBlockWithTimeout({ val playResponse = gPlayAPIRepository.getCategoriesList(type, authData).map { app -> val category = app.transformToFusedCategory() updateCategoryDrawable(category, app) updateCategoryDrawable(category) category } categoryList.addAll(playResponse) Loading Loading @@ -1045,7 +1045,6 @@ class FusedAPIImpl @Inject constructor( private fun updateCategoryDrawable( category: FusedCategory, app: Category ) { category.drawable = getCategoryIconResource(getCategoryIconName(category)) Loading Loading @@ -1083,7 +1082,7 @@ class FusedAPIImpl @Inject constructor( tag: AppTag ): List<FusedCategory> { return categories.apps.map { category -> createFusedCategoryFromCategory(category, categories, Category.Type.APPLICATION, tag) createFusedCategoryFromCategory(category, categories, tag) } } Loading @@ -1092,14 +1091,13 @@ class FusedAPIImpl @Inject constructor( tag: AppTag ): List<FusedCategory> { return categories.games.map { category -> createFusedCategoryFromCategory(category, categories, Category.Type.GAME, tag) createFusedCategoryFromCategory(category, categories, tag) } } private fun createFusedCategoryFromCategory( category: String, categories: Categories, appType: Category.Type, tag: AppTag ): FusedCategory { return FusedCategory( Loading