Bug 645858 complete -- update channel is now included in test pilot metadata
--- a/extension/modules/metadata.js
+++ b/extension/modules/metadata.js
@@ -42,16 +42,17 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://testpilot/modules/string_sanitizer.js");
const LOCALE_PREF = "general.useragent.locale";
const EXTENSION_ID = "testpilot@labs.mozilla.com";
const PREFIX_NS_EM = "http://www.mozilla.org/2004/em-rdf#";
const PREFIX_ITEM_URI = "urn:mozilla:item:";
+const UPDATE_CHANNEL_PREF = "app.update.channel";
/* The following preference, if present, stores answers to the basic panel
* survey, which tell us user's general tech level, and so should be included
* with any upload.*/
const SURVEY_ANS = "extensions.testpilot.surveyAnswers.basic_panel_survey_2";
let Application = Cc["@mozilla.org/fuel/application;1"]
.getService(Ci.fuelIApplication);
@@ -150,25 +151,30 @@ let MetadataCollector = {
callback(Application.extensions.get(EXTENSION_ID).version);
} else {
Application.getExtensions(function(extensions) {
callback(extensions.get(EXTENSION_ID).version);
});
}
},
+ getUpdateChannel: function MetadataCollector_getUpdateChannel() {
+ return Application.prefs.getValue(UPDATE_CHANNEL_PREF, "");
+ },
+
getMetadata: function MetadataCollector_getMetadata(callback) {
let self = this;
self.getTestPilotVersion(function(tpVersion) {
self.getExtensions(function(extensions) {
callback({ extensions: extensions,
accessibilities: self.getAccessibilities(),
location: self.getLocation(),
fxVersion: self.getVersion(),
operatingSystem: self.getOperatingSystem(),
tpVersion: tpVersion,
- surveyAnswers: self.getSurveyAnswers()}
+ surveyAnswers: self.getSurveyAnswers(),
+ updateChannel: self.getUpdateChannel()}
);
});
});
}
// TODO if we make a GUID for the user, we keep it here.
};