Revert "Update download every 5% progress to avoid noise"
This reverts commit 18dd3480cf.
When file sizes are big, progress may look stuck
This commit is contained in:
@@ -322,19 +322,14 @@ class DownloadWorker @AssistedInject constructor(
|
|||||||
this.speed = downloadInfo.speed
|
this.speed = downloadInfo.speed
|
||||||
this.timeRemaining = bytesRemaining / speed * 1000
|
this.timeRemaining = bytesRemaining / speed * 1000
|
||||||
}
|
}
|
||||||
|
downloadDao.updateProgress(
|
||||||
|
download.packageName,
|
||||||
|
download.progress,
|
||||||
|
download.speed,
|
||||||
|
download.timeRemaining
|
||||||
|
)
|
||||||
|
|
||||||
// Update progress every 5% to avoid noise
|
notifyStatus(DownloadStatus.DOWNLOADING, NOTIFICATION_ID)
|
||||||
if (totalProgress % 5 == 0) {
|
|
||||||
downloadDao.updateProgress(
|
|
||||||
download.packageName,
|
|
||||||
download.progress,
|
|
||||||
download.speed,
|
|
||||||
download.timeRemaining
|
|
||||||
)
|
|
||||||
|
|
||||||
notifyStatus(DownloadStatus.DOWNLOADING, NOTIFICATION_ID)
|
|
||||||
}
|
|
||||||
|
|
||||||
totalProgress = progress
|
totalProgress = progress
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user