2012-12-12 00:45:33 +00:00
|
|
|
#filter substitution
|
|
|
|
|
2012-09-10 16:54:41 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2012-10-31 16:13:28 +00:00
|
|
|
this.EXPORTED_SYMBOLS = ["UpdateChannel"];
|
2012-09-10 16:54:41 +00:00
|
|
|
|
|
|
|
const Cu = Components.utils;
|
|
|
|
|
|
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
|
|
|
|
2012-10-31 16:13:28 +00:00
|
|
|
this.UpdateChannel = {
|
2012-09-10 16:54:41 +00:00
|
|
|
/**
|
|
|
|
* Read the update channel from defaults only. We do this to ensure that
|
|
|
|
* the channel is tightly coupled with the application and does not apply
|
|
|
|
* to other instances of the application that may use the same profile.
|
|
|
|
*/
|
|
|
|
get: function UpdateChannel_get() {
|
2012-12-12 00:45:33 +00:00
|
|
|
let channel = "@MOZ_UPDATE_CHANNEL@";
|
2012-09-10 16:54:41 +00:00
|
|
|
let defaults = Services.prefs.getDefaultBranch(null);
|
|
|
|
try {
|
|
|
|
channel = defaults.getCharPref("app.update.channel");
|
|
|
|
} catch (e) {
|
2012-12-12 00:45:33 +00:00
|
|
|
// use default value when pref not found
|
2012-09-10 16:54:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
let partners = Services.prefs.getChildList("app.partner.").sort();
|
|
|
|
if (partners.length) {
|
|
|
|
channel += "-cck";
|
|
|
|
partners.forEach(function (prefName) {
|
|
|
|
channel += "-" + Services.prefs.getCharPref(prefName);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
Cu.reportError(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
return channel;
|
|
|
|
}
|
|
|
|
};
|