From 1225c34df262ece7a9f95ee5fe61c1985bf16df1 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 4 Oct 2013 16:02:50 -0700 Subject: Always update notifications, media scanner. insert() was trying to be too clever, and it would end up delaying the media scanner until the next download happened. This resulted in duplicate photos in DocumentsUI. Bug: 11081685 Change-Id: Ic9549ede38118372849119dd3a21415a4723e9f5 --- .../providers/downloads/DownloadProvider.java | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java index 750ee0fe..ad3cf7ac 100644 --- a/src/com/android/providers/downloads/DownloadProvider.java +++ b/src/com/android/providers/downloads/DownloadProvider.java @@ -683,23 +683,12 @@ public final class DownloadProvider extends ContentProvider { } insertRequestHeaders(db, rowID, values); - /* - * requests coming from - * DownloadManager.addCompletedDownload(String, String, String, - * boolean, String, String, long) need special treatment - */ - Context context = getContext(); - if (values.getAsInteger(Downloads.Impl.COLUMN_DESTINATION) == - Downloads.Impl.DESTINATION_NON_DOWNLOADMANAGER_DOWNLOAD) { - // When notification is requested, kick off service to process all - // relevant downloads. - if (Downloads.Impl.isNotificationToBeDisplayed(vis)) { - context.startService(new Intent(context, DownloadService.class)); - } - } else { - context.startService(new Intent(context, DownloadService.class)); - } notifyContentChanged(uri, match); + + // Always start service to handle notifications and/or scanning + final Context context = getContext(); + context.startService(new Intent(context, DownloadService.class)); + return ContentUris.withAppendedId(Downloads.Impl.CONTENT_URI, rowID); } -- cgit v1.2.3