Commit 68993f23 by olly Committed by Oliver Woodman

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
parent c830c8dc
...@@ -64,13 +64,12 @@ public final class DownloadNotificationHelper { ...@@ -64,13 +64,12 @@ public final class DownloadNotificationHelper {
boolean haveDownloadTasks = false; boolean haveDownloadTasks = false;
boolean haveRemoveTasks = false; boolean haveRemoveTasks = false;
for (Download download : downloads) { for (Download download : downloads) {
if (download.state == Download.STATE_REMOVING if (download.state == Download.STATE_REMOVING) {
|| download.state == Download.STATE_RESTARTING) {
haveRemoveTasks = true; haveRemoveTasks = true;
continue; continue;
} }
if (download.state != Download.STATE_DOWNLOADING if (download.state != Download.STATE_RESTARTING
&& download.state != Download.STATE_COMPLETED) { && download.state != Download.STATE_DOWNLOADING) {
continue; continue;
} }
haveDownloadTasks = true; haveDownloadTasks = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment