summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/DownloadService.java
diff options
context:
space:
mode:
authorSteve Howard <showard@google.com>2010-07-23 20:32:21 -0700
committerSteve Howard <showard@google.com>2010-07-23 20:32:21 -0700
commit93155e1da7e89d4925e244f5afa94afb8ada7381 (patch)
treea5cafd34f505277bf760162711eda1d90d9e0d4a /src/com/android/providers/downloads/DownloadService.java
parent691fc58e9a61d99ab5018c5ddc8349ed413e4470 (diff)
downloadandroid_packages_providers_DownloadProvider-93155e1da7e89d4925e244f5afa94afb8ada7381.tar.gz
android_packages_providers_DownloadProvider-93155e1da7e89d4925e244f5afa94afb8ada7381.tar.bz2
android_packages_providers_DownloadProvider-93155e1da7e89d4925e244f5afa94afb8ada7381.zip
Stub out and test system notifications.
This change abstracts NotificationManager interactions behind SystemFacade and takes advantage of that to test notifications, to a limited degree. It also fixes a silly typo in AbstractDownloadManagerFunctionalTest, and it introduces an extra sleep between tests to avoid some flakiness. I'll look for a better solution to that problem after this change goes in. Change-Id: I3a0307f828955cd45b0e3581ad499da28cc0556e
Diffstat (limited to 'src/com/android/providers/downloads/DownloadService.java')
-rw-r--r--src/com/android/providers/downloads/DownloadService.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/providers/downloads/DownloadService.java b/src/com/android/providers/downloads/DownloadService.java
index 472b4c5f..a6175953 100644
--- a/src/com/android/providers/downloads/DownloadService.java
+++ b/src/com/android/providers/downloads/DownloadService.java
@@ -218,8 +218,8 @@ public class DownloadService extends Service {
mMediaScannerConnecting = false;
mMediaScannerConnection = new MediaScannerConnection();
- mNotifier = new DownloadNotification(this);
- mNotifier.mNotificationMgr.cancelAll();
+ mNotifier = new DownloadNotification(this, mSystemFacade);
+ mSystemFacade.cancelAllNotifications();
mNotifier.updateNotification();
trimDatabase();
@@ -641,7 +641,7 @@ public class DownloadService extends Service {
if (info.mVisibility == Downloads.Impl.VISIBILITY_VISIBLE_NOTIFY_COMPLETED
&& newVisibility != Downloads.Impl.VISIBILITY_VISIBLE_NOTIFY_COMPLETED
&& Downloads.Impl.isStatusCompleted(info.mStatus)) {
- mNotifier.mNotificationMgr.cancel(info.mId);
+ mSystemFacade.cancelNotification(info.mId);
}
info.mVisibility = newVisibility;
synchronized (info) {
@@ -651,7 +651,7 @@ public class DownloadService extends Service {
int newStatus = cursor.getInt(statusColumn);
if (!Downloads.Impl.isStatusCompleted(info.mStatus) &&
Downloads.Impl.isStatusCompleted(newStatus)) {
- mNotifier.mNotificationMgr.cancel(info.mId);
+ mSystemFacade.cancelNotification(info.mId);
}
info.mStatus = newStatus;
info.mNumFailed = cursor.getInt(failedColumn);
@@ -724,7 +724,7 @@ public class DownloadService extends Service {
&& info.mFileName != null) {
new File(info.mFileName).delete();
}
- mNotifier.mNotificationMgr.cancel(info.mId);
+ mSystemFacade.cancelNotification(info.mId);
mDownloads.remove(arrayPos);
}