Loading app/src/main/java/foundation/e/apps/manager/download/DownloadManagerUtils.kt +2 −2 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class DownloadManagerUtils @Inject constructor( Timber.d("===> updateDownloadStatus: ${fusedDownload.name}: $downloadId: $numberOfDownloadedItems/${fusedDownload.downloadIdMap.size}") if (validateDownload(numberOfDownloadedItems, fusedDownload, downloadId)) { Timber.d("===> Download is completed for: ${fusedDownload.name}") Timber.i("===> Download is completed for: ${fusedDownload.name}") fusedManagerRepository.moveOBBFileToOBBDirectory(fusedDownload) fusedDownload.status = Status.DOWNLOADED fusedManagerRepository.updateFusedDownload(fusedDownload) Loading Loading @@ -109,7 +109,7 @@ class DownloadManagerUtils @Inject constructor( } fusedDownload.status = Status.INSTALLATION_ISSUE fusedManagerRepository.updateFusedDownload(fusedDownload) Timber.d("CleanApk signature is Wrong!") Timber.w("CleanApk signature is Wrong!") return false } } app/src/main/java/foundation/e/apps/manager/fused/FusedManagerRepository.kt +5 −4 Original line number Diff line number Diff line Loading @@ -34,18 +34,19 @@ class FusedManagerRepository @Inject constructor( return fusedManagerImpl.moveOBBFilesToOBBDirectory(fusedDownload) } suspend fun addDownload(fusedDownload: FusedDownload) { suspend fun addDownload(fusedDownload: FusedDownload): Boolean { if (InstallWorkManager.checkWorkIsAlreadyAvailable(fusedDownload.id)) { return return false } val existingFusedDownload = fusedManagerImpl.getDownloadById(fusedDownload) // We don't want to add any thing, if it already exists without INSTALLATION_ISSUE if (existingFusedDownload != null && existingFusedDownload.status != Status.INSTALLATION_ISSUE) { return return false } return fusedManagerImpl.addDownload(fusedDownload) fusedManagerImpl.addDownload(fusedDownload) return true } suspend fun addFusedDownloadPurchaseNeeded(fusedDownload: FusedDownload) { Loading app/src/main/java/foundation/e/apps/updates/manager/UpdatesWorker.kt +9 −4 Original line number Diff line number Diff line Loading @@ -109,9 +109,10 @@ class UpdatesWorker @AssistedInject constructor( * If user in UNAVAILABLE, don't do anything. */ resultStatus = ResultStatus.OK Timber.w("User is not available! User is required during update!") return } Timber.i("Updates found: ${appsNeededToUpdate.size}; $resultStatus") if (isAutoUpdate && shouldShowNotification) { handleNotification(appsNeededToUpdate.size, isConnectedToUnmeteredNetwork) } Loading Loading @@ -234,11 +235,15 @@ class UpdatesWorker @AssistedInject constructor( return@forEach } fusedManagerRepository.addDownload(fusedDownload) val isSuccess = fusedManagerRepository.addDownload(fusedDownload) if (!isSuccess) { Timber.i("Update adding ABORTED! status: $isSuccess") return@forEach } fusedManagerRepository.updateAwaiting(fusedDownload) Timber.d("startUpdateProcess: Enqueued for update: ${fusedDownload.name} ${fusedDownload.id} ${fusedDownload.status}") InstallWorkManager.enqueueWork(fusedDownload, true) Timber.i("startUpdateProcess: " + fusedDownload.name) Timber.i("startUpdateProcess: Enqueued for update: ${fusedDownload.name} ${fusedDownload.id} ${fusedDownload.status}") } } Loading app/src/main/java/foundation/e/apps/utils/enums/ResultStatus.kt +1 −3 Original line number Diff line number Diff line Loading @@ -4,8 +4,6 @@ enum class ResultStatus { OK, TIMEOUT, UNKNOWN, RETRY, ; RETRY; var message: String = "" } Loading
app/src/main/java/foundation/e/apps/manager/download/DownloadManagerUtils.kt +2 −2 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class DownloadManagerUtils @Inject constructor( Timber.d("===> updateDownloadStatus: ${fusedDownload.name}: $downloadId: $numberOfDownloadedItems/${fusedDownload.downloadIdMap.size}") if (validateDownload(numberOfDownloadedItems, fusedDownload, downloadId)) { Timber.d("===> Download is completed for: ${fusedDownload.name}") Timber.i("===> Download is completed for: ${fusedDownload.name}") fusedManagerRepository.moveOBBFileToOBBDirectory(fusedDownload) fusedDownload.status = Status.DOWNLOADED fusedManagerRepository.updateFusedDownload(fusedDownload) Loading Loading @@ -109,7 +109,7 @@ class DownloadManagerUtils @Inject constructor( } fusedDownload.status = Status.INSTALLATION_ISSUE fusedManagerRepository.updateFusedDownload(fusedDownload) Timber.d("CleanApk signature is Wrong!") Timber.w("CleanApk signature is Wrong!") return false } }
app/src/main/java/foundation/e/apps/manager/fused/FusedManagerRepository.kt +5 −4 Original line number Diff line number Diff line Loading @@ -34,18 +34,19 @@ class FusedManagerRepository @Inject constructor( return fusedManagerImpl.moveOBBFilesToOBBDirectory(fusedDownload) } suspend fun addDownload(fusedDownload: FusedDownload) { suspend fun addDownload(fusedDownload: FusedDownload): Boolean { if (InstallWorkManager.checkWorkIsAlreadyAvailable(fusedDownload.id)) { return return false } val existingFusedDownload = fusedManagerImpl.getDownloadById(fusedDownload) // We don't want to add any thing, if it already exists without INSTALLATION_ISSUE if (existingFusedDownload != null && existingFusedDownload.status != Status.INSTALLATION_ISSUE) { return return false } return fusedManagerImpl.addDownload(fusedDownload) fusedManagerImpl.addDownload(fusedDownload) return true } suspend fun addFusedDownloadPurchaseNeeded(fusedDownload: FusedDownload) { Loading
app/src/main/java/foundation/e/apps/updates/manager/UpdatesWorker.kt +9 −4 Original line number Diff line number Diff line Loading @@ -109,9 +109,10 @@ class UpdatesWorker @AssistedInject constructor( * If user in UNAVAILABLE, don't do anything. */ resultStatus = ResultStatus.OK Timber.w("User is not available! User is required during update!") return } Timber.i("Updates found: ${appsNeededToUpdate.size}; $resultStatus") if (isAutoUpdate && shouldShowNotification) { handleNotification(appsNeededToUpdate.size, isConnectedToUnmeteredNetwork) } Loading Loading @@ -234,11 +235,15 @@ class UpdatesWorker @AssistedInject constructor( return@forEach } fusedManagerRepository.addDownload(fusedDownload) val isSuccess = fusedManagerRepository.addDownload(fusedDownload) if (!isSuccess) { Timber.i("Update adding ABORTED! status: $isSuccess") return@forEach } fusedManagerRepository.updateAwaiting(fusedDownload) Timber.d("startUpdateProcess: Enqueued for update: ${fusedDownload.name} ${fusedDownload.id} ${fusedDownload.status}") InstallWorkManager.enqueueWork(fusedDownload, true) Timber.i("startUpdateProcess: " + fusedDownload.name) Timber.i("startUpdateProcess: Enqueued for update: ${fusedDownload.name} ${fusedDownload.id} ${fusedDownload.status}") } } Loading
app/src/main/java/foundation/e/apps/utils/enums/ResultStatus.kt +1 −3 Original line number Diff line number Diff line Loading @@ -4,8 +4,6 @@ enum class ResultStatus { OK, TIMEOUT, UNKNOWN, RETRY, ; RETRY; var message: String = "" }