From 5b7e8d4ada2b10f4e0d0cec6a6b3dd5ad4553161 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Mon, 4 Apr 2016 10:11:52 -0600 Subject: Remove stale download notifications. Bug: 27971263 Change-Id: Ia68d43828ecc32c1b6a656a0d3bb751b2a2e7881 --- src/com/android/providers/downloads/DownloadNotifier.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/com/android/providers') diff --git a/src/com/android/providers/downloads/DownloadNotifier.java b/src/com/android/providers/downloads/DownloadNotifier.java index a03f012c..5f961eb2 100644 --- a/src/com/android/providers/downloads/DownloadNotifier.java +++ b/src/com/android/providers/downloads/DownloadNotifier.java @@ -138,7 +138,6 @@ public class DownloadNotifier { for (DownloadInfo info : cluster) { wasDeleted = wasDeleted && info.mDeleted; } - return wasDeleted; } @@ -155,12 +154,15 @@ public class DownloadNotifier { } // Build notification for each cluster - for (String tag : clustered.keySet()) { + Iterator it = clustered.keySet().iterator(); + while (it.hasNext()) { + final String tag = it.next(); final int type = getNotificationTagType(tag); final Collection cluster = clustered.get(tag); // If each of the downloads was canceled, don't show notification for the cluster if (isClusterDeleted(cluster)) { + it.remove(); continue; } @@ -336,7 +338,7 @@ public class DownloadNotifier { } // Remove stale tags that weren't renewed - final Iterator it = mActiveNotifs.keySet().iterator(); + it = mActiveNotifs.keySet().iterator(); while (it.hasNext()) { final String tag = it.next(); if (!clustered.containsKey(tag)) { -- cgit v1.2.3