Bug 843452 - Part 4-3: [MMS] Get voiceInfo via MobileConnectionService. r=vicamo
authorEdgar Chen <echen@mozilla.com>
Tue, 01 Jul 2014 18:47:29 +0800
changeset 203338 580e30e552d4fbc189748aa6d68478bd12589a6e
parent 203337 40b544b38924df29e89e1fb015f25aefb43f1b4c
child 203339 7804996432d628350cb12f0a5bd48d3e479cb0f7
push id48665
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 20:40:15 +0000
treeherdermozilla-inbound@0da762e6868a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvicamo
bugs843452
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 843452 - Part 4-3: [MMS] Get voiceInfo via MobileConnectionService. r=vicamo
dom/mobilemessage/gonk/MmsService.js
--- a/dom/mobilemessage/gonk/MmsService.js
+++ b/dom/mobilemessage/gonk/MmsService.js
@@ -158,16 +158,20 @@ XPCOMUtils.defineLazyServiceGetter(this,
 XPCOMUtils.defineLazyServiceGetter(this, "gRil",
                                    "@mozilla.org/ril;1",
                                    "nsIRadioInterfaceLayer");
 
 XPCOMUtils.defineLazyServiceGetter(this, "gNetworkManager",
                                    "@mozilla.org/network/manager;1",
                                    "nsINetworkManager");
 
+XPCOMUtils.defineLazyServiceGetter(this, "gMobileConnectionService",
+                                   "@mozilla.org/mobileconnection/mobileconnectionservice;1",
+                                   "nsIMobileConnectionService");
+
 XPCOMUtils.defineLazyGetter(this, "MMS", function() {
   let MMS = {};
   Cu.import("resource://gre/modules/MmsPduHelper.jsm", MMS);
   return MMS;
 });
 
 // Internal Utilities
 
@@ -319,17 +323,18 @@ MmsConnection.prototype = {
   },
 
   /**
    * Return the roaming status of voice call.
    *
    * @return true if voice call is roaming.
    */
   isVoiceRoaming: function() {
-    let isRoaming = this.radioInterface.rilContext.voice.roaming;
+    let voice = gMobileConnectionService.getVoiceConnectionInfo(this.serviceId);
+    let isRoaming = voice.roaming;
     if (DEBUG) debug("isVoiceRoaming = " + isRoaming);
     return isRoaming;
   },
 
   /**
    * Get phone number from iccInfo.
    *
    * If the icc card is gsm card, the phone number is in msisdn.