Bug 609366 - Switching from 3G to Wifi stops the nightly update download and then restarting Fennec shows you the package installer for the partial package. r=mfinkle a=blocking-fennec
authorAlex Pakhotin <alexp@mozilla.com>
Thu, 18 Nov 2010 14:38:31 -0800
changeset 2440 5e38eda287acaf03a44b1e33bb78796c55dc49f2
parent 2439 7f7a0b341e87b2a2de782a49ef7677bbb1df5a1e
child 2441 93c37330e65491d24687182e6806ad81f49db932
push id2061
push userblassey@mozilla.com
push dateTue, 23 Nov 2010 19:31:22 +0000
reviewersmfinkle, blocking-fennec
bugs609366
Bug 609366 - Switching from 3G to Wifi stops the nightly update download and then restarting Fennec shows you the package installer for the partial package. r=mfinkle a=blocking-fennec
components/UpdatePrompt.js
--- a/components/UpdatePrompt.js
+++ b/components/UpdatePrompt.js
@@ -132,17 +132,18 @@ UpdatePrompt.prototype = {
         appStartup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
       }
     }
   },
 
   _updateDownloadProgress: function UP__updateDownloadProgress(aProgress, aTotal) {
     let alertsService = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
     let progressListener = alertsService.QueryInterface(Ci.nsIAlertsProgressListener);
-    progressListener.onProgress(UPDATE_NOTIFICATION_NAME, aProgress, aTotal);
+    if (progressListener)
+      progressListener.onProgress(UPDATE_NOTIFICATION_NAME, aProgress, aTotal);
   },
 
   // -------------------------
   // nsIUpdatePrompt interface
   // -------------------------
   
   checkForUpdates: function UP_checkForUpdates() {
     // NOT IMPL
@@ -202,16 +203,22 @@ UpdatePrompt.prototype = {
   
   // When the data transfer begins
   onStartRequest: function(request, context) {
     // NOT IMPL
   },
 
   // When the data transfer ends
   onStopRequest: function(request, context, status) {
+    let alertsService = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
+    let progressListener = alertsService.QueryInterface(Ci.nsIAlertsProgressListener);
+    if (progressListener)
+      progressListener.onCancel(UPDATE_NOTIFICATION_NAME);
+
+
     let aus = Cc["@mozilla.org/updates/update-service;1"].getService(Ci.nsIApplicationUpdateService);
     aus.removeDownloadListener(this);
   },
 
   // ------------------------------
   // nsIProgressEventSink interface
   // ------------------------------