Bug 645858 - Include Firefox update channel in metadata [r=mark.finkle]
authorJono X <jdicarlo@mozilla.com>
Mon, 11 Apr 2011 22:30:44 -0400
changeset 67888 7a8f522fc75a
parent 67887 8929076380f4
child 67889 7c0c0b502a11
push id19453
push usermfinkle@mozilla.com
push dateTue, 12 Apr 2011 02:35:14 +0000
treeherdermozilla-central@2a2c474ec4a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmark
bugs645858
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 645858 - Include Firefox update channel in metadata [r=mark.finkle]
browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/metadata.js
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/metadata.js
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/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.
 };