From 289493fbd0a8d6ebf45ddcb4477e528a8c0a5cde Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Mon, 11 Aug 2014 16:24:27 +0800 Subject: [PATCH] Bug 843452 - Part 4-8: [MobileIdentityManager] Get {voice|data}Info via MobileConnectionService. r=ferjmoreno --- services/mobileid/MobileIdentityManager.jsm | 24 +++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/services/mobileid/MobileIdentityManager.jsm b/services/mobileid/MobileIdentityManager.jsm index c8dc1a89f12..2ccf6741184 100644 --- a/services/mobileid/MobileIdentityManager.jsm +++ b/services/mobileid/MobileIdentityManager.jsm @@ -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 }); }