Bug 645858 complete -- update channel is now included in test pilot metadata
authorJono X <jono@mozilla.com>
Mon, 28 Mar 2011 15:31:23 -0700
changeset 567 72b7052ec3feba54e89fb5f383569e96a625151e
parent 566 3d24eff556a199289d4ec366a353bac1f9f97d06
child 568 a875928fabfa443a7d821b83c3f1be7216e66f08
push id469
push userjdicarlo@mozilla.com
push dateMon, 28 Mar 2011 22:31:28 +0000
bugs645858
Bug 645858 complete -- update channel is now included in test pilot metadata
extension/modules/metadata.js
--- 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.
 };