mirror of
https://github.com/samsonjs/media.git
synced 2026-04-04 11:05:47 +00:00
Improve DownloadNotificationHelper
- Remove completed downloads from progress notification. - Treat restarting as a downloading, When there are both remove and download tasks ongoing, we prefer to show a download notification to a remove one. A restarting task encapsulates is basically a (remove+download) task. Given our preference, we should treat it as a download rather than as a removal. PiperOrigin-RevId: 242867228
This commit is contained in:
parent
c830c8dc63
commit
68993f233d
1 changed files with 3 additions and 4 deletions
|
|
@ -64,13 +64,12 @@ public final class DownloadNotificationHelper {
|
|||
boolean haveDownloadTasks = false;
|
||||
boolean haveRemoveTasks = false;
|
||||
for (Download download : downloads) {
|
||||
if (download.state == Download.STATE_REMOVING
|
||||
|| download.state == Download.STATE_RESTARTING) {
|
||||
if (download.state == Download.STATE_REMOVING) {
|
||||
haveRemoveTasks = true;
|
||||
continue;
|
||||
}
|
||||
if (download.state != Download.STATE_DOWNLOADING
|
||||
&& download.state != Download.STATE_COMPLETED) {
|
||||
if (download.state != Download.STATE_RESTARTING
|
||||
&& download.state != Download.STATE_DOWNLOADING) {
|
||||
continue;
|
||||
}
|
||||
haveDownloadTasks = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue