Bug 1052846 - Part 3: Use enums for MobileNetworkType in nsIMobileConnectionService.idl (gonk). r=echen

This commit is contained in:
Jessica Jong 2014-11-18 10:07:02 +08:00
parent c656364ed5
commit 5b5039fce3
2 changed files with 9 additions and 4 deletions

View File

@ -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;
},
/**

View File

@ -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",