Bug 801987 - [OTA update] system notification never reappears after dismissing "Later" and then force updating [r=marshall]
authorFabrice Desré <fabrice@mozilla.com>
Tue, 16 Oct 2012 22:07:59 -0700
changeset 110641 9fba5058ab84be2e336debca29feed5672e0d8c7
parent 110640 ab6c7006403e163bd62b45e1c297fee9ece5b351
child 110642 30332bf91baf9ccdfe7d11620a6eb9cb4f0e149c
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersmarshall
bugs801987
milestone19.0a1
Bug 801987 - [OTA update] system notification never reappears after dismissing "Later" and then force updating [r=marshall]
b2g/components/UpdatePrompt.js
--- a/b2g/components/UpdatePrompt.js
+++ b/b2g/components/UpdatePrompt.js
@@ -305,16 +305,24 @@ UpdatePrompt.prototype = {
       log("Error: Couldn't reboot into recovery to apply FOTA update " +
           aOsUpdatePath);
     }
   },
 
   forceUpdateCheck: function UP_forceUpdateCheck() {
     log("Forcing update check");
 
+    // If we already have an active update available, don't try to
+    // download again, just prompt for install.
+    if (Services.um.activeUpdate) {
+      this.setUpdateStatus("check-complete");
+      this.showApplyPrompt(Services.um.activeUpdate);
+      return;
+    }
+
     let checker = Cc["@mozilla.org/updates/update-checker;1"]
                     .createInstance(Ci.nsIUpdateChecker);
     checker.checkForUpdates(this, true);
   },
 
   handleEvent: function UP_handleEvent(evt) {
     if (evt.type !== "mozContentEvent") {
       return;