Loading app/src/main/java/foundation/e/apps/data/DownloadManager.kt +7 −2 Original line number Diff line number Diff line Loading @@ -173,6 +173,12 @@ class DownloadManager @Inject constructor( } } /** * Checks download is successful or not. * @param downloadId is the id of a particular download request * @return Pair<Boolean, Int>, Where first represents success/failure, * second represents status. */ fun isDownloadSuccessful(downloadId: Long): Pair<Boolean, Int> { val downloadStatus = getDownloadStatus(downloadId) val isSuccessFul = downloadStatus == DownloadManager.STATUS_SUCCESSFUL Loading @@ -180,8 +186,7 @@ class DownloadManager @Inject constructor( } fun hasDownloadFailed(downloadId: Long): Boolean { val downloadStatus = getDownloadStatus(downloadId) return downloadStatus == DownloadManager.STATUS_FAILED return getDownloadStatus(downloadId) == DownloadManager.STATUS_FAILED } fun getSizeRequired(downloadId: Long): Long { Loading app/src/main/java/foundation/e/apps/install/download/DownloadManagerUtils.kt +1 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ class DownloadManagerUtils @Inject constructor( downloadId: Long ): Boolean { val isDownloadSuccessful = downloadManager.isDownloadSuccessful(downloadId) // if download status code is unknown (-1), consider installation is failed. if (isDownloadSuccessful.second == -1) { handleDownloadFailed(fusedDownload, downloadId) } Loading Loading
app/src/main/java/foundation/e/apps/data/DownloadManager.kt +7 −2 Original line number Diff line number Diff line Loading @@ -173,6 +173,12 @@ class DownloadManager @Inject constructor( } } /** * Checks download is successful or not. * @param downloadId is the id of a particular download request * @return Pair<Boolean, Int>, Where first represents success/failure, * second represents status. */ fun isDownloadSuccessful(downloadId: Long): Pair<Boolean, Int> { val downloadStatus = getDownloadStatus(downloadId) val isSuccessFul = downloadStatus == DownloadManager.STATUS_SUCCESSFUL Loading @@ -180,8 +186,7 @@ class DownloadManager @Inject constructor( } fun hasDownloadFailed(downloadId: Long): Boolean { val downloadStatus = getDownloadStatus(downloadId) return downloadStatus == DownloadManager.STATUS_FAILED return getDownloadStatus(downloadId) == DownloadManager.STATUS_FAILED } fun getSizeRequired(downloadId: Long): Long { Loading
app/src/main/java/foundation/e/apps/install/download/DownloadManagerUtils.kt +1 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ class DownloadManagerUtils @Inject constructor( downloadId: Long ): Boolean { val isDownloadSuccessful = downloadManager.isDownloadSuccessful(downloadId) // if download status code is unknown (-1), consider installation is failed. if (isDownloadSuccessful.second == -1) { handleDownloadFailed(fusedDownload, downloadId) } Loading