summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSteve Howard <showard@google.com>2010-09-15 12:29:50 -0700
committerSteve Howard <showard@google.com>2010-09-20 11:34:54 -0700
commit3398db8f3b195959faa2a7cf09918f364432ac28 (patch)
treeb274d3f30d22bb3d56100cb18e3ade5a83c91b71 /tests
parent4bebe75b3e2361d7fb0aa966598c41c45ad9317f (diff)
downloadandroid_packages_providers_DownloadProvider-3398db8f3b195959faa2a7cf09918f364432ac28.tar.gz
android_packages_providers_DownloadProvider-3398db8f3b195959faa2a7cf09918f364432ac28.tar.bz2
android_packages_providers_DownloadProvider-3398db8f3b195959faa2a7cf09918f364432ac28.zip
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
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/providers/downloads/FakeSystemFacade.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/src/com/android/providers/downloads/FakeSystemFacade.java b/tests/src/com/android/providers/downloads/FakeSystemFacade.java
index 40b2a900..d80bd4ad 100644
--- a/tests/src/com/android/providers/downloads/FakeSystemFacade.java
+++ b/tests/src/com/android/providers/downloads/FakeSystemFacade.java
@@ -19,7 +19,7 @@ public class FakeSystemFacade implements SystemFacade {
boolean mIsRoaming = false;
Long mMaxBytesOverMobile = null;
List<Intent> mBroadcastsSent = new ArrayList<Intent>();
- Map<Integer,Notification> mActiveNotifications = new HashMap<Integer,Notification>();
+ Map<Long,Notification> mActiveNotifications = new HashMap<Long,Notification>();
List<Notification> mCanceledNotifications = new ArrayList<Notification>();
Queue<Thread> mStartedThreads = new LinkedList<Thread>();
@@ -54,7 +54,7 @@ public class FakeSystemFacade implements SystemFacade {
}
@Override
- public void postNotification(int id, Notification notification) {
+ public void postNotification(long id, Notification notification) {
if (notification == null) {
throw new AssertionFailedError("Posting null notification");
}
@@ -62,7 +62,7 @@ public class FakeSystemFacade implements SystemFacade {
}
@Override
- public void cancelNotification(int id) {
+ public void cancelNotification(long id) {
Notification notification = mActiveNotifications.remove(id);
if (notification != null) {
mCanceledNotifications.add(notification);
@@ -71,7 +71,7 @@ public class FakeSystemFacade implements SystemFacade {
@Override
public void cancelAllNotifications() {
- for (int id : mActiveNotifications.keySet()) {
+ for (long id : mActiveNotifications.keySet()) {
cancelNotification(id);
}
}