Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3334)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java

Issue 2781873002: Properly clean up notification on download open (Closed)
Patch Set: More rebase bugs Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotifier.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
index 91208d9774d8c44e8b3d39343b4be85c3543d6bf..fccde2811681e1e9e5361031942c67567e1cf5dd 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
@@ -794,12 +794,14 @@ public class DownloadNotificationService extends Service {
}
/**
- * Cancel a download notification.
+ * Removes a download notification and all associated tracking. This method relies on the
+ * caller to provide the notification id, which is useful in the case where the internal
+ * tracking doesn't exist (e.g. in the case of a successful download, where we show the download
+ * completed notification and remove our internal state tracking).
* @param notificationId Notification ID of the download
* @param id The {@link ContentId} of the download.
*/
- @VisibleForTesting
- void cancelNotification(int notificationId, ContentId id) {
+ public void cancelNotification(int notificationId, ContentId id) {
mNotificationManager.cancel(NOTIFICATION_NAMESPACE, notificationId);
mDownloadSharedPreferenceHelper.removeSharedPreferenceEntry(id);
@@ -813,7 +815,8 @@ public class DownloadNotificationService extends Service {
}
/**
- * Called when a download is canceled.
+ * Called when a download is canceled. This method uses internal tracking to try to find the
+ * notification id to cancel.
* @param id The {@link ContentId} of the download.
*/
@VisibleForTesting
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotifier.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698