diff --git a/dom/mobileconnection/gonk/MobileConnectionService.js b/dom/mobileconnection/gonk/MobileConnectionService.js index 332abc20314d..b88428fe8571 100644 --- a/dom/mobileconnection/gonk/MobileConnectionService.js +++ b/dom/mobileconnection/gonk/MobileConnectionService.js @@ -398,6 +398,7 @@ MobileConnectionProvider.prototype = { RIL.GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT.split(","); } + let enumNetworkTypes = []; for (let type of supportedNetworkTypes) { // If the value in system property is not valid, use the default one which // is defined in ril_consts.js. @@ -405,15 +406,18 @@ MobileConnectionProvider.prototype = { if (DEBUG) { this._debug("Unknown network type: " + type); } - supportedNetworkTypes = - RIL.GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT.split(","); + RIL.GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT.split(",").forEach(aType => { + enumNetworkTypes.push(RIL.GECKO_SUPPORTED_NETWORK_TYPES.indexOf(aType)); + }); break; } + enumNetworkTypes.push(RIL.GECKO_SUPPORTED_NETWORK_TYPES.indexOf(type)); } if (DEBUG) { - this._debug("Supported Network Types: " + supportedNetworkTypes); + this._debug("Supported Network Types: " + enumNetworkTypes); } - return supportedNetworkTypes; + + return enumNetworkTypes; }, /** diff --git a/dom/system/gonk/ril_consts.js b/dom/system/gonk/ril_consts.js index 14f8eeaaf503..620f4f42ef37 100644 --- a/dom/system/gonk/ril_consts.js +++ b/dom/system/gonk/ril_consts.js @@ -427,6 +427,7 @@ this.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO = [ ]; this.GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT = "gsm,wcdma"; +// Index-item pair must be in sync with nsIMobileConnection.MOBILE_NETWORK_TYPE_* this.GECKO_SUPPORTED_NETWORK_TYPES = [ "gsm", "wcdma",