Bug 1010284 - Add radio tech mapping for MLS. r=garvank, sr=hannosch
authorAlexandre Lissy <lissyx@lissyx.dyndns.org>
Tue, 30 Sep 2014 07:11:00 -0400
changeset 231796 4b751d735154dc7862b39c00c30d9a46a6aeb47d
parent 231795 3ee91aabf87aa8d0fd20622a83f18ae06d90c550
child 231797 262bb8e131fea2bfb9a8f80dda8f9d4885b2aa11
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgarvank, hannosch
bugs1010284
milestone35.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 1010284 - Add radio tech mapping for MLS. r=garvank, sr=hannosch Having this mapping is needed in order to properly identify the radio technology family being used by the connected network.
dom/system/NetworkGeolocationProvider.js
--- a/dom/system/NetworkGeolocationProvider.js
+++ b/dom/system/NetworkGeolocationProvider.js
@@ -419,22 +419,36 @@ WifiGeoPositionProvider.prototype = {
         LOG("Looking for SIM in slot:" + i + " of " + service.length);
         let connection = service.getItemByServiceId(i);
         let voice = connection && connection.voice;
         let cell = voice && voice.cell;
         let type = voice && voice.type;
         let network = voice && voice.network;
 
         if (network && cell && type) {
-          if (type === "gsm" || type === "gprs" || type === "edge") {
-            type = "gsm";
-          } else {
-            type = "wcdma";
-          }
-          result.push({ radio: type,
+          let radioTechFamily;
+          switch (type) {
+            case "gsm":
+            case "gprs":
+            case "edge":
+              radioTechFamily = "gsm";
+              break;
+            case "umts":
+            case "hsdpa":
+            case "hsupa":
+            case "hspa":
+            case "hspa+":
+              radioTechFamily = "wcdma";
+              break;
+            case "lte":
+              radioTechFamily = "lte";
+              break;
+            // CDMA cases to be handled in bug 1010282
+          };
+          result.push({ radio: radioTechFamily,
                       mobileCountryCode: voice.network.mcc,
                       mobileNetworkCode: voice.network.mnc,
                       locationAreaCode: cell.gsmLocationAreaCode,
                       cellId: cell.gsmCellId });
         }
       }
       return result;
     } catch (e) {