Bug 1429150 - Change nsIApplicationUpdateService::canCheckForUpdates implementation to respect new enterprise policy preventing app update r=Felipe,mhowell

MozReview-Commit-ID: 7vPaDbONcRr

--HG--
extra : rebase_source : 9c9f75dd72c9acdc2f70311e0fed31366f51bc13
This commit is contained in:
Kirk Steuber 2018-02-08 09:41:54 -08:00
Родитель dea9e6d333
Коммит 77b64d365c
2 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -137,8 +137,10 @@ appUpdater.prototype =
// true when updating is disabled by an administrator.
get updateDisabledAndLocked() {
return !this.updateEnabled &&
Services.prefs.prefIsLocked("app.update.enabled");
return (!this.updateEnabled &&
Services.prefs.prefIsLocked("app.update.enabled")) ||
(Services.policies &&
!Services.policies.isAllowed("appUpdate"));
},
// true when updating is enabled.

Просмотреть файл

@ -538,6 +538,12 @@ XPCOMUtils.defineLazyGetter(this, "gCanCheckForUpdates", function aus_gCanCheckF
return false;
}
if (Services.policies && !Services.policies.isAllowed("appUpdate")) {
LOG("gCanCheckForUpdates - unable to automatically check for updates. " +
"Functionality disabled by enterprise policy.");
return false;
}
// If we don't know the binary platform we're updating, we can't update.
if (!UpdateUtils.ABI) {
LOG("gCanCheckForUpdates - unable to check for updates, unknown ABI");