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

Commit 351327e2 authored by Hasib Prince's avatar Hasib Prince
Browse files

temporary fix is applied for test purpose

parent 887bb26e
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ class DatabaseRepository @Inject constructor(

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

@@ -35,7 +35,7 @@ class DatabaseRepository @Inject constructor(
        return fusedDownloadDAO.getDownloadLiveList()
    }

    suspend fun updateDownload(fusedDownload: FusedDownload): Long {
    suspend fun updateDownload(fusedDownload: FusedDownload): Int {
        mutex.withLock {
            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): Long
    suspend fun updateDownload(fusedDownload: FusedDownload): Int

    @Delete
    suspend fun deleteDownload(fusedDownload: FusedDownload)
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ class FusedManagerImpl @Inject constructor(

    suspend fun addDownload(fusedDownload: FusedDownload) {
        fusedDownload.status = Status.QUEUED
        databaseRepository.addDownload(fusedDownload)
        return databaseRepository.addDownload(fusedDownload)
    }

    suspend fun getDownloadById(fusedDownload: FusedDownload): FusedDownload? {
+5 −4
Original line number Diff line number Diff line
@@ -34,18 +34,19 @@ class FusedManagerRepository @Inject constructor(
        return fusedManagerImpl.moveOBBFilesToOBBDirectory(fusedDownload)
    }

    suspend fun addDownload(fusedDownload: FusedDownload) {
    suspend fun addDownload(fusedDownload: FusedDownload): Int {
        if (InstallWorkManager.checkWorkIsAlreadyAvailable(fusedDownload.id)) {
            return
            return -1
        }

        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 -1
        }

        return fusedManagerImpl.addDownload(fusedDownload)
        fusedManagerImpl.addDownload(fusedDownload)
        return 0
    }

    suspend fun addFusedDownloadPurchaseNeeded(fusedDownload: FusedDownload) {
+2 −0
Original line number Diff line number Diff line
@@ -62,6 +62,8 @@ class PWAPlayerStatusReceiver : BroadcastReceiver() {
                            ACTION_PWA_REMOVED -> {
                                databaseRepository.deleteDownload(fusedDownload)
                            }

                            else -> {}
                        }
                    }
                }
Loading