Loading app/src/main/java/foundation/e/apps/data/gitlab/SystemAppsUpdatesRepository.kt +8 −5 Original line number Diff line number Diff line Loading @@ -43,8 +43,15 @@ class SystemAppsUpdatesRepository @Inject constructor( private var systemAppProjectList = mutableListOf<SystemAppProject>() suspend fun fetchUpdatableSystemApps() { private fun getUpdatableSystemApps(): List<String> { return systemAppProjectList.map { it.packageName } } suspend fun fetchUpdatableSystemApps(forceRefresh: Boolean = false) { val result = handleNetworkResult { if (getUpdatableSystemApps().isNotEmpty() && !forceRefresh) { return@handleNetworkResult } val response = updatableSystemAppsApi.getUpdatableSystemApps() if (response.isSuccessful && !response.body().isNullOrEmpty()) { response.body()?.let { systemAppProjectList.addAll(it) } Loading @@ -58,10 +65,6 @@ class SystemAppsUpdatesRepository @Inject constructor( } } fun getUpdatableSystemApps(): List<String> { return systemAppProjectList.map { it.packageName } } private fun isSystemAppBlocked( systemAppInfo: SystemAppInfo, sdkLevel: Int, Loading app/src/main/java/foundation/e/apps/install/updates/UpdatesWorker.kt +1 −7 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ class UpdatesWorker @AssistedInject constructor( } refreshBlockedAppList() refreshEligibleSystemApps() systemAppsUpdatesRepository.fetchUpdatableSystemApps(forceRefresh = true) checkForUpdates() Result.success() } catch (e: Throwable) { Loading @@ -83,12 +83,6 @@ class UpdatesWorker @AssistedInject constructor( } } private suspend fun refreshEligibleSystemApps() { if (systemAppsUpdatesRepository.getEligibleSystemApps().isEmpty()) { systemAppsUpdatesRepository.fetchEligibleSystemApps() } } private suspend fun checkManualUpdateRunning(): Boolean { val workInfos = withContext(Dispatchers.IO) { Loading Loading
app/src/main/java/foundation/e/apps/data/gitlab/SystemAppsUpdatesRepository.kt +8 −5 Original line number Diff line number Diff line Loading @@ -43,8 +43,15 @@ class SystemAppsUpdatesRepository @Inject constructor( private var systemAppProjectList = mutableListOf<SystemAppProject>() suspend fun fetchUpdatableSystemApps() { private fun getUpdatableSystemApps(): List<String> { return systemAppProjectList.map { it.packageName } } suspend fun fetchUpdatableSystemApps(forceRefresh: Boolean = false) { val result = handleNetworkResult { if (getUpdatableSystemApps().isNotEmpty() && !forceRefresh) { return@handleNetworkResult } val response = updatableSystemAppsApi.getUpdatableSystemApps() if (response.isSuccessful && !response.body().isNullOrEmpty()) { response.body()?.let { systemAppProjectList.addAll(it) } Loading @@ -58,10 +65,6 @@ class SystemAppsUpdatesRepository @Inject constructor( } } fun getUpdatableSystemApps(): List<String> { return systemAppProjectList.map { it.packageName } } private fun isSystemAppBlocked( systemAppInfo: SystemAppInfo, sdkLevel: Int, Loading
app/src/main/java/foundation/e/apps/install/updates/UpdatesWorker.kt +1 −7 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ class UpdatesWorker @AssistedInject constructor( } refreshBlockedAppList() refreshEligibleSystemApps() systemAppsUpdatesRepository.fetchUpdatableSystemApps(forceRefresh = true) checkForUpdates() Result.success() } catch (e: Throwable) { Loading @@ -83,12 +83,6 @@ class UpdatesWorker @AssistedInject constructor( } } private suspend fun refreshEligibleSystemApps() { if (systemAppsUpdatesRepository.getEligibleSystemApps().isEmpty()) { systemAppsUpdatesRepository.fetchEligibleSystemApps() } } private suspend fun checkManualUpdateRunning(): Boolean { val workInfos = withContext(Dispatchers.IO) { Loading