summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2016-04-04 10:11:52 -0600
committerJeff Sharkey <jsharkey@android.com>2016-04-04 10:11:54 -0600
commit5b7e8d4ada2b10f4e0d0cec6a6b3dd5ad4553161 (patch)
treee6919b9c9842f1aa940c409e04199250a64e113d /src/com/android/providers
parent08fa91badf0b34323c535dde6f8113e16ae94e21 (diff)
downloadandroid_packages_providers_DownloadProvider-5b7e8d4ada2b10f4e0d0cec6a6b3dd5ad4553161.tar.gz
android_packages_providers_DownloadProvider-5b7e8d4ada2b10f4e0d0cec6a6b3dd5ad4553161.tar.bz2
android_packages_providers_DownloadProvider-5b7e8d4ada2b10f4e0d0cec6a6b3dd5ad4553161.zip
Remove stale download notifications.
Bug: 27971263 Change-Id: Ia68d43828ecc32c1b6a656a0d3bb751b2a2e7881
Diffstat (limited to 'src/com/android/providers')
-rw-r--r--src/com/android/providers/downloads/DownloadNotifier.java8
1 files changed, 5 insertions, 3 deletions
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<String> it = clustered.keySet().iterator();
+ while (it.hasNext()) {
+ final String tag = it.next();
final int type = getNotificationTagType(tag);
final Collection<DownloadInfo> 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<String> it = mActiveNotifs.keySet().iterator();
+ it = mActiveNotifs.keySet().iterator();
while (it.hasNext()) {
final String tag = it.next();
if (!clustered.containsKey(tag)) {