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

Commit 887bb26e authored by Hasib Prince's avatar Hasib Prince
Browse files

some logs added for update process

parent cf97b6ed
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -35,9 +35,9 @@ class DatabaseRepository @Inject constructor(
        return fusedDownloadDAO.getDownloadLiveList()
    }

    suspend fun updateDownload(fusedDownload: FusedDownload) {
    suspend fun updateDownload(fusedDownload: FusedDownload): Long {
        mutex.withLock {
            fusedDownloadDAO.updateDownload(fusedDownload)
            return fusedDownloadDAO.updateDownload(fusedDownload)
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ interface FusedDownloadDAO {
    fun getDownloadFlowById(id: String): LiveData<FusedDownload>

    @Update
    suspend fun updateDownload(fusedDownload: FusedDownload)
    suspend fun updateDownload(fusedDownload: FusedDownload): Long

    @Delete
    suspend fun deleteDownload(fusedDownload: FusedDownload)
+6 −2
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ class FusedManagerImpl @Inject constructor(
    }

    private suspend fun downloadNativeApp(fusedDownload: FusedDownload) {
        Timber.d("===> downloadNativeApp: ${fusedDownload.name}")
        var count = 0
        var parentPath = "$cacheDir/${fusedDownload.packageName}"

@@ -195,7 +196,8 @@ class FusedManagerImpl @Inject constructor(
        File(parentPath).mkdirs()

        fusedDownload.status = Status.DOWNLOADING
        databaseRepository.updateDownload(fusedDownload)
        val id = databaseRepository.updateDownload(fusedDownload)
        Timber.d("===> downloadNativeApp: updateDownload: line:200, ${fusedDownload.name}  $id")
        DownloadProgressLD.setDownloadId(-1)
        fusedDownload.downloadURLList.forEach {
            count += 1
@@ -208,10 +210,12 @@ class FusedManagerImpl @Inject constructor(
                .setTitle(if (count == 1) fusedDownload.name else "Additional file for ${fusedDownload.name}")
                .setDestinationUri(Uri.fromFile(packagePath))
            val requestId = downloadManager.enqueue(request)
            Timber.d("===> downloadNativeApp: downloadRequestID: $requestId")
            DownloadProgressLD.setDownloadId(requestId)
            fusedDownload.downloadIdMap[requestId] = false
        }
        databaseRepository.updateDownload(fusedDownload)
        val updateid = databaseRepository.updateDownload(fusedDownload)
        Timber.d("===> downloadNativeApp: updateDownload: line:217, ${fusedDownload.name}  $updateid")
    }

    private fun getGplayInstallationPackagePath(
+2 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ class UpdatesWorker @AssistedInject constructor(
            checkForUpdates()
            Result.success()
        } catch (e: Throwable) {
            Timber.e(e, "===> Update worker error")
            Result.failure()
        } finally {
            if (shouldShowNotification && automaticInstallEnabled) {
@@ -152,6 +153,7 @@ class UpdatesWorker @AssistedInject constructor(
        } else {
            EventBus.invokeEvent(AppEvent.UpdateEvent(ResultSupreme.WorkError(ResultStatus.UNKNOWN)))
        }
        Timber.d("===> update manageretry: $retryCount")
    }

    private suspend fun triggerUpdateProcessOnSettings(