From 3398db8f3b195959faa2a7cf09918f364432ac28 Mon Sep 17 00:00:00 2001 From: Steve Howard Date: Wed, 15 Sep 2010 12:29:50 -0700 Subject: Fix notification bugs, cleanup DownloadService + DownloadReceiver This change started out just fixing a few regressions related to notifications: * Browser downloads weren't picking up a title from the determined filename. This was due to my change to default the title field to "" instead of null. * Notification click/hide events weren't being handled properly. This was due to previous change to the URI structure of DownloadProvider. DownloadReceiver needed to be changed to perform queries through /all_downloads URIs, like all other parts of the download manager code. I did some general refactoring of the DownloadReceiver code while I was there. * The code in DownloadNotification wasn't picking up some updates to downloads properly. This was due to my change to make DownloadNotification use the DownloadInfo objects rather than querying the database directly, so that it could make use of info provided by the DownloadThread that didn't go into the DB. Fixing this didn't turn out to be all that complicated, but along the way to figuring this out I made some substantial refactoring in DownloadService which made it much cleaner anyway and eliminated a lot of duplication. That's something that had to happen eventually, so I'm leaving it all in. Change-Id: I847ccf80e3d928c84e36bc24791b33204104e1b2 --- ui/src/com/android/providers/downloads/ui/DownloadList.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/src/com/android/providers/downloads/ui/DownloadList.java b/ui/src/com/android/providers/downloads/ui/DownloadList.java index fce2f162..71e17233 100644 --- a/ui/src/com/android/providers/downloads/ui/DownloadList.java +++ b/ui/src/com/android/providers/downloads/ui/DownloadList.java @@ -19,6 +19,7 @@ package com.android.providers.downloads.ui; import android.app.Activity; import android.app.AlertDialog; import android.content.ActivityNotFoundException; +import android.content.ContentUris; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; @@ -365,7 +366,7 @@ public class DownloadList extends Activity Intent intent = new Intent("android.intent.action.DOWNLOAD_LIST"); intent.setClassName("com.android.providers.downloads", "com.android.providers.downloads.DownloadReceiver"); - intent.setData(Uri.parse(Downloads.Impl.CONTENT_URI + "/" + id)); + intent.setData(ContentUris.withAppendedId(Downloads.Impl.ALL_DOWNLOADS_CONTENT_URI, id)); intent.putExtra("multiple", false); sendBroadcast(intent); } -- cgit v1.2.3