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 208581 4b751d735154dc7862b39c00c30d9a46a6aeb47d
parent 208580 3ee91aabf87aa8d0fd20622a83f18ae06d90c550
child 208582 262bb8e131fea2bfb9a8f80dda8f9d4885b2aa11
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersgarvank, hannosch
bugs1010284
milestone35.0a1
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) {