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 7a8f522fc75ad4228a8abda1a0e14ae7abf9a643
parent 67887 8929076380f48c28cbea5a0dfe601eda848a82b1
child 67889 7c0c0b502a11b1723b0c80867d43d1c4ca8af65e
push idunknown
push userunknown
push dateunknown
reviewersmark
bugs645858
milestone2.2a1pre
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.
 };