From d7363fb59f72730e12b2c0ec9ba263d0da2950ed Mon Sep 17 00:00:00 2001 From: "benjamin%smedbergs.us" Date: Fri, 8 Sep 2006 20:09:24 +0000 Subject: [PATCH] Bug 351714 - create software update channel for partner builds dynamically, r=robstrong git-svn-id: svn://10.0.0.236/trunk@209463 18797224-902f-48f8-a5cc-f745e15eee43 --- .../mozapps/update/src/nsUpdateService.js.in | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in b/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in index 2980b29c95d..7fd4cb618e8 100644 --- a/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in +++ b/mozilla/toolkit/mozapps/update/src/nsUpdateService.js.in @@ -57,6 +57,7 @@ const PREF_APP_EXTENSIONS_VERSION = "app.extensions.version"; const PREF_GENERAL_USERAGENT_LOCALE = "general.useragent.locale"; const PREF_APP_UPDATE_INCOMPATIBLE_MODE = "app.update.incompatible.mode"; const PREF_UPDATE_NEVER_BRANCH = "app.update.never." +const PREF_PARTNER_BRANCH = "app.partner."; const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul"; const URI_UPDATE_HISTORY_DIALOG = "chrome://mozapps/content/update/history.xul"; @@ -459,14 +460,36 @@ function getLocale() { * to other instances of the application that may use the same profile. */ function getUpdateChannel() { + var channel = "default"; + var prefName; + var prefValue; + var defaults = gPref.QueryInterface(Components.interfaces.nsIPrefService). getDefaultBranch(null); try { - return defaults.getCharPref(PREF_APP_UPDATE_CHANNEL); + channel = defaults.getCharPref(PREF_APP_UPDATE_CHANNEL); } catch (e) { - return "default"; // failover when pref not found + // use default when pref not found } + + try { + var partners = gPref.getChildList(PREF_PARTNER_BRANCH, { }); + if (partners.length) { + channel += "-cck"; + partners.sort(); + + for each (prefName in partners) { + prefValue = gPref.getCharPref(prefName); + channel += "-" + prefValue; + } + } + } + catch (e) { + Components.utils.reportError(e); + } + + return channel; } /**