Bug 843452 - Part 4-8: [MobileIdentityManager] Get {voice|data}Info via MobileConnectionService. r=ferjmoreno

This commit is contained in:
Edgar Chen 2014-08-11 16:24:27 +08:00
Родитель 94212cd1a3
Коммит 14f1104ef5
1 изменённых файлов: 15 добавлений и 9 удалений

Просмотреть файл

@ -59,6 +59,10 @@ XPCOMUtils.defineLazyServiceGetter(this, "gRil",
XPCOMUtils.defineLazyServiceGetter(this, "iccProvider",
"@mozilla.org/ril/content-helper;1",
"nsIIccProvider");
XPCOMUtils.defineLazyServiceGetter(this, "mobileConnectionService",
"@mozilla.org/mobileconnection/mobileconnectionservice;1",
"nsIMobileConnectionService");
#endif
@ -123,15 +127,17 @@ this.MobileIdentityManager = {
continue;
}
let voice = mobileConnectionService.getVoiceConnectionInfo(i);
let data = mobileConnectionService.getDataConnectionInfo(i);
let operator = null;
if (rilContext.voice.network &&
rilContext.voice.network.shortName &&
rilContext.voice.network.shortName.length) {
operator = rilContext.voice.network.shortName;
} else if (rilContext.data.network &&
rilContext.data.network.shortName &&
rilContext.data.network.shortName.length) {
operator = rilContext.data.network.shortName;
if (voice.network &&
voice.network.shortName &&
voice.network.shortName.length) {
operator = voice.network.shortName;
} else if (data.network &&
data.network.shortName &&
data.network.shortName.length) {
operator = data.network.shortName;
}
this._iccInfo.push({
@ -142,7 +148,7 @@ this.MobileIdentityManager = {
msisdn: info.msisdn || info.mdn || null,
operator: operator,
serviceId: i,
roaming: rilContext.voice.roaming
roaming: voice.roaming
});
}