Bug 1001542 - Add PRODUCT_DEVICE to the list of url substitutable fields. r=rstrong
authorDave Hylands <dhylands@mozilla.com>
Wed, 14 May 2014 11:50:23 -0700
changeset 183221 7e8524eaa2ce2428a111ff6c668316415776366d
parent 183220 a128d315bc5462e7a65d0c9dd1988d13449d6bb6
child 183222 79303f175ba5df220209088062791564cc9437d8
push id26788
push userkwierso@gmail.com
push dateThu, 15 May 2014 22:46:24 +0000
treeherdermozilla-central@827f4dc53387 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong
bugs1001542
milestone32.0a1
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 1001542 - Add PRODUCT_DEVICE to the list of url substitutable fields. r=rstrong
toolkit/mozapps/update/nsUpdateService.js
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -311,16 +311,20 @@ XPCOMUtils.defineLazyGetter(this, "gABI"
   return abi;
 });
 
 #ifdef MOZ_WIDGET_GONK
 XPCOMUtils.defineLazyGetter(this, "gProductModel", function aus_gProductModel() {
   Cu.import("resource://gre/modules/systemlibs.js");
   return libcutils.property_get("ro.product.model");
 });
+XPCOMUtils.defineLazyGetter(this, "gProductDevice", function aus_gProductDevice() {
+  Cu.import("resource://gre/modules/systemlibs.js");
+  return libcutils.property_get("ro.product.device");
+});
 #endif
 
 XPCOMUtils.defineLazyGetter(this, "gOSVersion", function aus_gOSVersion() {
   let osVersion;
   let sysInfo = Cc["@mozilla.org/system-info;1"].
                 getService(Ci.nsIPropertyBag2);
   try {
     osVersion = sysInfo.getProperty("name") + " " + sysInfo.getProperty("version");
@@ -3571,16 +3575,17 @@ Checker.prototype = {
                       getDistributionPrefValue(PREF_APP_DISTRIBUTION));
     url = url.replace(/%DISTRIBUTION_VERSION%/g,
                       getDistributionPrefValue(PREF_APP_DISTRIBUTION_VERSION));
     url = url.replace(/%CUSTOM%/g, getPref("getCharPref", PREF_APP_UPDATE_CUSTOM, ""));
     url = url.replace(/\+/g, "%2B");
 
 #ifdef MOZ_WIDGET_GONK
     url = url.replace(/%PRODUCT_MODEL%/g, gProductModel);
+    url = url.replace(/%PRODUCT_DEVICE%/g, gProductDevice);
     url = url.replace(/%B2G_VERSION%/g, getPref("getCharPref", PREF_APP_B2G_VERSION, null));
 #endif
 
     if (force)
       url += (url.indexOf("?") != -1 ? "&" : "?") + "force=1";
 
     LOG("Checker:getUpdateURL - update URL: " + url);
     return url;