Bug 1162331 - refreshUpdateStatus incorrectly checks if the service should be used. r=spohl

This commit is contained in:
Robert Strong 2015-05-07 10:35:09 -07:00
parent 7221302f38
commit 603b72ce41

View File

@ -497,7 +497,7 @@ function hasUpdateMutex() {
XPCOMUtils.defineLazyGetter(this, "gCanApplyUpdates", function aus_gCanApplyUpdates() {
let useService = false;
if (shouldUseService() && isServiceInstalled()) {
if (shouldUseService()) {
// No need to perform directory write checks, the maintenance service will
// be able to write to all directories.
LOG("gCanApplyUpdates - bypass the write checks because we'll use the service");
@ -648,8 +648,7 @@ function getCanStageUpdates() {
return false;
}
if (AppConstants.platform == "win" && isServiceInstalled() &&
shouldUseService()) {
if (AppConstants.platform == "win" && shouldUseService()) {
// No need to perform directory write checks, the maintenance service will
// be able to write to all directories.
LOG("getCanStageUpdates - able to stage updates using the service");
@ -1025,13 +1024,12 @@ function releaseSDCardMountLock() {
/**
* Determines if the service should be used to attempt an update
* or not. For now this is only when PREF_APP_UPDATE_SERVICE_ENABLED
* is true and we have Firefox.
* or not.
*
* @return true if the service should be used for updates.
*/
function shouldUseService() {
if (AppConstants.MOZ_MAINTENANCE_SERVICE) {
if (AppConstants.MOZ_MAINTENANCE_SERVICE && isServiceInstalled()) {
return getPref("getBoolPref",
PREF_APP_UPDATE_SERVICE_ENABLED, false);
}
@ -4214,7 +4212,7 @@ Downloader.prototype = {
if (maxProgress != this._patch.size) {
LOG("Downloader:onProgress - maxProgress: " + maxProgress +
" is not equal to expectd patch size: " + this._patch.size);
" is not equal to expected patch size: " + this._patch.size);
// It's important that we use a different code than
// NS_ERROR_CORRUPTED_CONTENT so that tests can verify the difference
// between a hash error and a wrong download error.