Bug 1010278 - Check if the type is gsm-ish or wcdma-ish and assign to either one of those categories. r=dougt, a=1.4+
authorGarvan Keeley <gkeeley@mozilla.com>
Thu, 19 Jun 2014 14:45:00 -0400
changeset 208679 e2b455dd98dc55f333974ff5954ea1e8a01534fb
parent 208678 0e7a7d248e400db0326339523fc4f1c853df1d5d
child 208680 afea0cb928b529d194ec7a96fabbe6aa3b1280b3
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt, 1
bugs1010278
milestone32.0a2
Bug 1010278 - Check if the type is gsm-ish or wcdma-ish and assign to either one of those categories. r=dougt, a=1.4+
dom/system/NetworkGeolocationProvider.js
--- a/dom/system/NetworkGeolocationProvider.js
+++ b/dom/system/NetworkGeolocationProvider.js
@@ -238,20 +238,25 @@ WifiGeoPositionProvider.prototype = {
                     .getService(Ci.nsIRadioInterfaceLayer);
       let numInterfaces = radioService.numRadioInterfaces;
       let result = [];
       for (let i = 0; i < numInterfaces; i++) {
         LOG("Looking for SIM in slot:" + i + " of " + numInterfaces);
         let radio = radioService.getRadioInterface(i);
         let iccInfo = radio.rilContext.iccInfo;
         let cell = radio.rilContext.voice.cell;
+        let type = radio.rilContext.voice.type;
 
-        if (iccInfo && cell) {
-          // TODO type and signal strength
-          result.push({ radio: "gsm",
+        if (iccInfo && cell && type) {
+          if (type === "gsm" || type === "gprs" || type === "edge") {
+            type = "gsm";
+          } else {
+            type = "wcdma";
+          }
+          result.push({ radio: type,
                       mobileCountryCode: iccInfo.mcc,
                       mobileNetworkCode: iccInfo.mnc,
                       locationAreaCode: cell.gsmLocationAreaCode,
                       cellId: cell.gsmCellId });
         }
       }
       return result;
     } catch (e) {