Bug 1010278 - Check if the type is gsm-ish or wcdma-ish and assign to either one of those categories. r=dougt
authorGarvan Keeley <gkeeley@mozilla.com>
Thu, 19 Jun 2014 14:45:00 -0400
changeset 191604 5993d1e919b1b6032f859b7963614a52be08228d
parent 191603 f11efe794cc89b847e88c4c843c2375fd7abe72f
child 191605 e94590e830ff9c1ce826e54f8e1721ce5dec3394
push id45618
push userkwierso@gmail.com
push dateTue, 01 Jul 2014 01:47:43 +0000
treeherdermozilla-inbound@d0787b1eebc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs1010278
milestone33.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 1010278 - Check if the type is gsm-ish or wcdma-ish and assign to either one of those categories. r=dougt
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) {