From b88f4b99d44480824edf2a04002509945efa0195 Mon Sep 17 00:00:00 2001 From: Alex Pakhotin Date: Thu, 18 Nov 2010 14:38:31 -0800 Subject: [PATCH] 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 --- mobile/components/UpdatePrompt.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mobile/components/UpdatePrompt.js b/mobile/components/UpdatePrompt.js index 98d5c1b5889..55aa60a1807 100644 --- a/mobile/components/UpdatePrompt.js +++ b/mobile/components/UpdatePrompt.js @@ -137,7 +137,8 @@ UpdatePrompt.prototype = { _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); }, // ------------------------- @@ -207,6 +208,12 @@ UpdatePrompt.prototype = { // 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); },