From 4359b2efa52ab524d70897a7dbe22d3dfb496de1 Mon Sep 17 00:00:00 2001 From: Danesh Mondegarian Date: Mon, 20 Apr 2015 23:28:14 -0700 Subject: DownloadManager : Only remove stale id if download is not deleted This addresses the issue where if a download is enqueued and right after deleted, the notification doesn't stick around. Change-Id: Ie1ec08fc94420b0f46e1543ed52afd8c22aee372 (cherry picked from commit 794ab54677c50bac5c0f32bc5d9ad768ff10c039) --- src/com/android/providers/downloads/DownloadService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/providers/downloads/DownloadService.java b/src/com/android/providers/downloads/DownloadService.java index 58cf380c..48aa2d84 100644 --- a/src/com/android/providers/downloads/DownloadService.java +++ b/src/com/android/providers/downloads/DownloadService.java @@ -364,7 +364,6 @@ public class DownloadService extends Service { final int idColumn = cursor.getColumnIndexOrThrow(Downloads.Impl._ID); while (cursor.moveToNext()) { final long id = cursor.getLong(idColumn); - staleIds.remove(id); DownloadInfo info = mDownloads.get(id); if (info != null) { @@ -396,6 +395,7 @@ public class DownloadService extends Service { isActive |= activeDownload; isActive |= activeScan; + staleIds.remove(id); } // Keep track of nearest next action -- cgit v1.2.3