diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-10-04 16:02:50 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2013-10-04 16:03:04 -0700 |
commit | 1225c34df262ece7a9f95ee5fe61c1985bf16df1 (patch) | |
tree | f53afa36fb7bb8eb128c1987527cd6b55b7752ad /src/com/android/providers/downloads | |
parent | dfb6502136dc6683166f2104d93c22e1b72e1818 (diff) | |
download | android_packages_providers_DownloadProvider-1225c34df262ece7a9f95ee5fe61c1985bf16df1.tar.gz android_packages_providers_DownloadProvider-1225c34df262ece7a9f95ee5fe61c1985bf16df1.tar.bz2 android_packages_providers_DownloadProvider-1225c34df262ece7a9f95ee5fe61c1985bf16df1.zip |
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
Diffstat (limited to 'src/com/android/providers/downloads')
-rw-r--r-- | src/com/android/providers/downloads/DownloadProvider.java | 21 |
1 files changed, 5 insertions, 16 deletions
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); } |