Bug 1130834 - Explictly cancel ongoing download notifications instead of trying to update them to be non-ongoing. r=wesj, a=lmandel
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Sun, 22 Feb 2015 17:18:39 -0800
changeset 250233 2f6284a0d529
parent 250232 84a2cfba8deb
child 250234 1f4073c76b2b
push id4523
push userryanvm@gmail.com
push date2015-03-04 17:35 +0000
treeherdermozilla-beta@729cf69ef43f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj, lmandel
bugs1130834
milestone37.0
Bug 1130834 - Explictly cancel ongoing download notifications instead of trying to update them to be non-ongoing. r=wesj, a=lmandel
mobile/android/modules/DownloadNotifications.jsm
--- a/mobile/android/modules/DownloadNotifications.jsm
+++ b/mobile/android/modules/DownloadNotifications.jsm
@@ -232,16 +232,22 @@ DownloadNotification.prototype = {
   },
 
   showOrUpdate: function () {
     this._updateFromDownload();
 
     if (this._show) {
       if (!this.id) {
         this.id = Notifications.create(this.options);
+      } else if (!this.options.ongoing) {
+        // We need to explictly cancel ongoing notifications,
+        // since updating them to be non-ongoing doesn't seem
+        // to work. See bug 1130834.
+        Notifications.cancel(this.id);
+        this.id = Notifications.create(this.options);
       } else {
         Notifications.update(this.id, this.options);
       }
     } else {
       this.hide();
     }
   },