зеркало из https://github.com/mozilla/pjs.git
Bug 392496: New AUS update URL v3, send distribution information. r=sspitzer
This commit is contained in:
Родитель
8ea75cf452
Коммит
b13d3a26e5
|
@ -102,7 +102,7 @@ pref("app.update.mode", 1);
|
||||||
pref("app.update.silent", false);
|
pref("app.update.silent", false);
|
||||||
|
|
||||||
// Update service URL:
|
// Update service URL:
|
||||||
pref("app.update.url", "https://aus2.mozilla.org/update/2/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/update.xml");
|
pref("app.update.url", "https://aus2.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
|
||||||
// app.update.url.manual is in branding section
|
// app.update.url.manual is in branding section
|
||||||
// app.update.url.details is in branding section
|
// app.update.url.details is in branding section
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,8 @@ const PREF_GENERAL_USERAGENT_LOCALE = "general.useragent.locale";
|
||||||
const PREF_APP_UPDATE_INCOMPATIBLE_MODE = "app.update.incompatible.mode";
|
const PREF_APP_UPDATE_INCOMPATIBLE_MODE = "app.update.incompatible.mode";
|
||||||
const PREF_UPDATE_NEVER_BRANCH = "app.update.never.";
|
const PREF_UPDATE_NEVER_BRANCH = "app.update.never.";
|
||||||
const PREF_PARTNER_BRANCH = "app.partner.";
|
const PREF_PARTNER_BRANCH = "app.partner.";
|
||||||
|
const PREF_APP_DISTRIBUTION = "distribution.id";
|
||||||
|
const PREF_APP_DISTRIBUTION_VERSION = "distribution.version";
|
||||||
|
|
||||||
const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul";
|
const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul";
|
||||||
const URI_UPDATE_HISTORY_DIALOG = "chrome://mozapps/content/update/history.xul";
|
const URI_UPDATE_HISTORY_DIALOG = "chrome://mozapps/content/update/history.xul";
|
||||||
|
@ -539,6 +541,22 @@ function getUpdateChannel() {
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get the distribution pref values, from defaults only */
|
||||||
|
function getDistributionPrefValue(aPrefName) {
|
||||||
|
var prefValue = "default";
|
||||||
|
|
||||||
|
var defaults =
|
||||||
|
gPref.QueryInterface(Components.interfaces.nsIPrefService).
|
||||||
|
getDefaultBranch(null);
|
||||||
|
try {
|
||||||
|
prefValue = defaults.getCharPref(aPrefName);
|
||||||
|
} catch (e) {
|
||||||
|
// use default when pref not found
|
||||||
|
}
|
||||||
|
|
||||||
|
return prefValue;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enumeration of items in a JS array.
|
* An enumeration of items in a JS array.
|
||||||
* @constructor
|
* @constructor
|
||||||
|
@ -1940,6 +1958,10 @@ Checker.prototype = {
|
||||||
url = url.replace(/%LOCALE%/g, getLocale());
|
url = url.replace(/%LOCALE%/g, getLocale());
|
||||||
url = url.replace(/%CHANNEL%/g, getUpdateChannel());
|
url = url.replace(/%CHANNEL%/g, getUpdateChannel());
|
||||||
url = url.replace(/%PLATFORM_VERSION%/g, gApp.platformVersion);
|
url = url.replace(/%PLATFORM_VERSION%/g, gApp.platformVersion);
|
||||||
|
url = url.replace(/%DISTRIBUTION%/g,
|
||||||
|
getDistributionPrefValue(PREF_APP_DISTRIBUTION));
|
||||||
|
url = url.replace(/%DISTRIBUTION_VERSION%/g,
|
||||||
|
getDistributionPrefValue(PREF_APP_DISTRIBUTION_VERSION));
|
||||||
url = url.replace(/\+/g, "%2B");
|
url = url.replace(/\+/g, "%2B");
|
||||||
|
|
||||||
if (force)
|
if (force)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче