Bug 926343 - Part 6: Use default clientId in PhoneNumberUtils. r=gwagner

This commit is contained in:
Edgar Chen 2013-10-16 18:15:55 +08:00
parent 49c41c0bbd
commit c79d5a7143

View File

@ -43,15 +43,22 @@ this.PhoneNumberUtils = {
let countryName;
#ifdef MOZ_B2G_RIL
// Get network mcc
// TODO: Bug 926740 - PhoneNumberUtils for multisim
let voice = mobileConnection.getVoiceConnectionInfo(0);
// In Multi-sim, there is more than one client in
// iccProvider/mobileConnectionProvider. Each client represents a
// icc/mobileConnection service. To maintain the backward compatibility with
// single sim, we always use client 0 for now. Adding support for multiple
// sim will be addressed in bug 926740, if needed.
let clientId = 0;
// Get network mcc
let voice = mobileConnection.getVoiceConnectionInfo(clientId);
if (voice && voice.network && voice.network.mcc) {
mcc = voice.network.mcc;
}
// Get SIM mcc
let iccInfo = icc.iccInfo;
let iccInfo = icc.getIccInfo(clientId);
if (!mcc && iccInfo && iccInfo.mcc) {
mcc = iccInfo.mcc;
}