diff --git a/browser/base/content/aboutDialog.js b/browser/base/content/aboutDialog.js index e3358b2a401..461375ec3bd 100644 --- a/browser/base/content/aboutDialog.js +++ b/browser/base/content/aboutDialog.js @@ -194,7 +194,7 @@ appUpdater.prototype = // true when updating in background is enabled. get backgroundUpdateEnabled() { return this.updateEnabled && - Services.prefs.getBoolPref("app.update.stage.enabled"); + gAppUpdater.aus.canStageUpdates; }, // true when updating is automatic. diff --git a/toolkit/mozapps/update/content/updates.js b/toolkit/mozapps/update/content/updates.js index 304416e45bb..c6548fb653e 100644 --- a/toolkit/mozapps/update/content/updates.js +++ b/toolkit/mozapps/update/content/updates.js @@ -15,7 +15,6 @@ const CoR = Components.results; const XMLNS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; -const PREF_APP_UPDATE_BACKGROUND = "app.update.stage.enabled"; const PREF_APP_UPDATE_BACKGROUNDERRORS = "app.update.backgroundErrors"; const PREF_APP_UPDATE_BILLBOARD_TEST_URL = "app.update.billboard.test_url"; const PREF_APP_UPDATE_CERT_ERRORS = "app.update.cert.errors"; @@ -1581,7 +1580,9 @@ var gDownloadingPage = { LOG("gDownloadingPage", "onStopRequest - patch verification succeeded"); // If the background update pref is set, we should wait until the update // is actually staged in the background. - if (getPref("getBoolPref", PREF_APP_UPDATE_BACKGROUND, false)) { + var aus = CoC["@mozilla.org/updates/update-service;1"]. + getService(CoI.nsIApplicationUpdateService); + if (aus.canStageUpdates) { this._setUpdateApplying(); } else { this.cleanUp(); diff --git a/toolkit/mozapps/update/nsIUpdateService.idl b/toolkit/mozapps/update/nsIUpdateService.idl index 374f6796279..72016515199 100644 --- a/toolkit/mozapps/update/nsIUpdateService.idl +++ b/toolkit/mozapps/update/nsIUpdateService.idl @@ -352,7 +352,7 @@ interface nsIUpdateChecker : nsISupports * background update checks and provides utilities for selecting and * downloading update patches. */ -[scriptable, uuid(7bd62f69-f604-484b-b97c-e7229d7a3ee8)] +[scriptable, uuid(900b4a18-3bef-4f3e-bcf5-84dce0021c6d)] interface nsIApplicationUpdateService : nsISupports { /** @@ -422,6 +422,11 @@ interface nsIApplicationUpdateService : nsISupports * privileges to the install directory. */ readonly attribute boolean canApplyUpdates; + + /** + * Whether the Update Service is able to stage updates. + */ + readonly attribute boolean canStageUpdates; }; /** diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js index daf776ff221..95e479f529e 100644 --- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -2046,6 +2046,13 @@ UpdateService.prototype = { return gCanApplyUpdates; }, + /** + * See nsIUpdateService.idl + */ + get canStageUpdates() { + return gCanStageUpdates; + }, + /** * See nsIUpdateService.idl */