Bug 1075405 - Use numItems to iterate mobile connection providers. r=echen
Using .length attribute does not work anymore, probably after
bug
1063304 landed. The GonkVoicemail code makes a similar use of the
MobileConnectionService and uses numItems to iterate over the providers.
--- a/dom/system/NetworkGeolocationProvider.js
+++ b/dom/system/NetworkGeolocationProvider.js
@@ -410,18 +410,18 @@ WifiGeoPositionProvider.prototype = {
LOG("getMobileInfo called");
try {
let radioService = Cc["@mozilla.org/ril;1"]
.getService(Ci.nsIRadioInterfaceLayer);
let service = Cc["@mozilla.org/mobileconnection/mobileconnectionservice;1"]
.getService(Ci.nsIMobileConnectionService);
let result = [];
- for (let i = 0; i < service.length; i++) {
- LOG("Looking for SIM in slot:" + i + " of " + service.length);
+ for (let i = 0; i < service.numItems; i++) {
+ LOG("Looking for SIM in slot:" + i + " of " + service.numItems);
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) {
let radioTechFamily;