Bug 866272 - expose privileged access to mcc+mnc pair for last home network and roaming network r=gal
authorFabrice Desré <fabrice@mozilla.com>
Thu, 02 May 2013 18:37:51 -0700
changeset 141863 730f44b9f32a8371e45940cdd9762fd2f08948de
parent 141787 7ef3c04c75333b80236f0409f55c604df78d30be
child 141864 c7f5441bee0a3e95a2ecac0b8adfc620f6b0286b
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal
bugs866272
milestone23.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 866272 - expose privileged access to mcc+mnc pair for last home network and roaming network r=gal
dom/apps/src/PermissionsTable.jsm
dom/base/Navigator.cpp
dom/network/interfaces/nsIDOMMobileConnection.idl
dom/network/src/MobileConnection.cpp
dom/network/src/MobileConnection.h
dom/system/gonk/RadioInterfaceLayer.js
--- a/dom/apps/src/PermissionsTable.jsm
+++ b/dom/apps/src/PermissionsTable.jsm
@@ -114,16 +114,21 @@ this.PermissionsTable =  { geolocation: 
                              privileged: DENY_ACTION,
                              certified: ALLOW_ACTION
                            },
                            mobileconnection: {
                              app: DENY_ACTION,
                              privileged: DENY_ACTION,
                              certified: ALLOW_ACTION
                            },
+                           mobilenetwork: {
+                             app: DENY_ACTION,
+                             privileged: ALLOW_ACTION,
+                             certified: ALLOW_ACTION
+                           },
                            power: {
                              app: DENY_ACTION,
                              privileged: DENY_ACTION,
                              certified: ALLOW_ACTION
                            },
                            push: {
                             app: ALLOW_ACTION,
                             privileged: ALLOW_ACTION,
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1356,17 +1356,18 @@ NS_IMETHODIMP
 Navigator::GetMozMobileConnection(nsIDOMMozMobileConnection** aMobileConnection)
 {
   *aMobileConnection = nullptr;
 
   if (!mMobileConnection) {
     nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mWindow);
     NS_ENSURE_TRUE(window, NS_OK);
 
-    if (!CheckPermission("mobileconnection")) {
+    if (!CheckPermission("mobileconnection") &&
+        !CheckPermission("mobilenetwork")) {
       return NS_OK;
     }
 
     mMobileConnection = new network::MobileConnection();
     mMobileConnection->Init(window);
   }
 
   NS_ADDREF(*aMobileConnection = mMobileConnection);
--- a/dom/network/interfaces/nsIDOMMobileConnection.idl
+++ b/dom/network/interfaces/nsIDOMMobileConnection.idl
@@ -8,30 +8,37 @@ interface nsIDOMEventListener;
 interface nsIDOMDOMRequest;
 interface nsIDOMMozMobileICCInfo;
 interface nsIDOMMozMobileConnectionInfo;
 interface nsIDOMMozMobileNetworkInfo;
 interface nsIDOMMozMobileCellInfo;
 interface nsIDOMMozIccManager;
 interface nsIDOMMozMobileCFInfo;
 
-[scriptable, builtinclass, uuid(bde7e16c-ff1f-4c7f-b1cd-480984cbb206)]
+[scriptable, builtinclass, uuid(780de142-562c-4141-bd5c-5413fb1952d2)]
 interface nsIDOMMozMobileConnection : nsIDOMEventTarget
 {
   const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
   const long ICC_SERVICE_CLASS_DATA = (1 << 1);
   const long ICC_SERVICE_CLASS_FAX = (1 << 2);
   const long ICC_SERVICE_CLASS_SMS = (1 << 3);
   const long ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4);
   const long ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
   const long ICC_SERVICE_CLASS_PACKET = (1 << 6);
   const long ICC_SERVICE_CLASS_PAD = (1 << 7);
   const long ICC_SERVICE_CLASS_MAX = (1 << 7);
 
   /**
+   * These two fields can be accessed by privileged applications with the
+   * 'mobilenetwork' permission.
+   */
+  readonly attribute DOMString lastKnownNetwork;
+  readonly attribute DOMString lastKnownHomeNetwork;
+
+  /**
    * Indicates the state of the device's ICC card.
    *
    * Possible values: null, 'unknown', 'absent', 'pinRequired', 'pukRequired',
    * 'networkLocked', 'corporateLocked', 'serviceProviderLocked', 'ready'.
    */
   readonly attribute DOMString cardState;
 
   /**
--- a/dom/network/src/MobileConnection.cpp
+++ b/dom/network/src/MobileConnection.cpp
@@ -6,16 +6,18 @@
 #include "nsIDOMDOMRequest.h"
 #include "nsIDOMClassInfo.h"
 #include "nsDOMEvent.h"
 #include "nsIDOMUSSDReceivedEvent.h"
 #include "nsIDOMDataErrorEvent.h"
 #include "nsIDOMCFStateChangeEvent.h"
 #include "nsIDOMICCCardLockErrorEvent.h"
 #include "GeneratedEvents.h"
+#include "mozilla/Preferences.h"
+#include "nsIPermissionManager.h"
 
 #include "nsContentUtils.h"
 #include "nsJSUtils.h"
 #include "nsJSON.h"
 #include "jsapi.h"
 #include "mozilla/Services.h"
 #include "IccManager.h"
 
@@ -76,37 +78,44 @@ NS_IMPL_EVENT_HANDLER(MobileConnection, 
 NS_IMPL_EVENT_HANDLER(MobileConnection, ussdreceived)
 NS_IMPL_EVENT_HANDLER(MobileConnection, dataerror)
 NS_IMPL_EVENT_HANDLER(MobileConnection, icccardlockerror)
 NS_IMPL_EVENT_HANDLER(MobileConnection, cfstatechange)
 
 MobileConnection::MobileConnection()
 {
   mProvider = do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
+  mWindow = nullptr;
 
   // Not being able to acquire the provider isn't fatal since we check
   // for it explicitly below.
   if (!mProvider) {
     NS_WARNING("Could not acquire nsIMobileConnectionProvider!");
     return;
   }
-
-  mListener = new Listener(this);
-  DebugOnly<nsresult> rv = mProvider->RegisterMobileConnectionMsg(mListener);
-  NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
-                   "Failed registering mobile connection messages with provider");
 }
 
 void
 MobileConnection::Init(nsPIDOMWindow* aWindow)
 {
   BindToOwner(aWindow);
 
-  mIccManager = new icc::IccManager();
-  mIccManager->Init(aWindow);
+  mWindow = do_GetWeakReference(aWindow);
+  mListener = new Listener(this);
+
+  if (!CheckPermission("mobilenetwork") &&
+      CheckPermission("mobileconnection")) {
+    DebugOnly<nsresult> rv = mProvider->RegisterMobileConnectionMsg(mListener);
+    NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
+                     "Failed registering mobile connection messages with provider");
+
+    mIccManager = new icc::IccManager();
+    mIccManager->Init(aWindow);
+    printf_stderr("MobileConnection & IccManager initialized");
+  }
 }
 
 void
 MobileConnection::Shutdown()
 {
   if (mProvider && mListener) {
     mListener->Disconnect();
     mProvider->UnregisterMobileConnectionMsg(mListener);
@@ -118,278 +127,408 @@ MobileConnection::Shutdown()
     mIccManager->Shutdown();
     mIccManager = nullptr;
   }
 }
 
 // nsIDOMMozMobileConnection
 
 NS_IMETHODIMP
+MobileConnection::GetLastKnownNetwork(nsAString& network)
+{
+  network.SetIsVoid(true);
+
+  if (!CheckPermission("mobilenetwork")) {
+    return NS_OK;
+  }
+
+  network = mozilla::Preferences::GetString("ril.lastKnownNetwork");
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+MobileConnection::GetLastKnownHomeNetwork(nsAString& network)
+{
+  network.SetIsVoid(true);
+
+  if (!CheckPermission("mobilenetwork")) {
+    return NS_OK;
+  }
+
+  network = mozilla::Preferences::GetString("ril.lastKnownHomeNetwork");
+  return NS_OK;
+}
+
+// All fields below require the "mobileconnection" permission.
+
+bool
+MobileConnection::CheckPermission(const char* type)
+{
+  nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mWindow);
+  NS_ENSURE_TRUE(window, false);
+
+  nsCOMPtr<nsIPermissionManager> permMgr =
+    do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);
+  NS_ENSURE_TRUE(permMgr, false);
+
+  uint32_t permission = nsIPermissionManager::DENY_ACTION;
+  permMgr->TestPermissionFromWindow(window, type, &permission);
+  return permission == nsIPermissionManager::ALLOW_ACTION;
+}
+
+NS_IMETHODIMP
 MobileConnection::GetCardState(nsAString& cardState)
 {
-  if (!mProvider) {
-    cardState.SetIsVoid(true);
+  cardState.SetIsVoid(true);
+
+  if (!mProvider || !CheckPermission("mobileconnection")) {
     return NS_OK;
   }
   return mProvider->GetCardState(cardState);
 }
 
 NS_IMETHODIMP
 MobileConnection::GetIccInfo(nsIDOMMozMobileICCInfo** aIccInfo)
 {
-  if (!mProvider) {
-    *aIccInfo = nullptr;
+  *aIccInfo = nullptr;
+
+  if (!mProvider || !CheckPermission("mobileconnection")) {
     return NS_OK;
   }
   return mProvider->GetIccInfo(aIccInfo);
 }
 
 NS_IMETHODIMP
 MobileConnection::GetVoice(nsIDOMMozMobileConnectionInfo** voice)
 {
-  if (!mProvider) {
-    *voice = nullptr;
+  *voice = nullptr;
+
+  if (!mProvider || !CheckPermission("mobileconnection")) {
     return NS_OK;
   }
   return mProvider->GetVoiceConnectionInfo(voice);
 }
 
 NS_IMETHODIMP
 MobileConnection::GetData(nsIDOMMozMobileConnectionInfo** data)
 {
-  if (!mProvider) {
-    *data = nullptr;
+  *data = nullptr;
+
+  if (!mProvider || !CheckPermission("mobileconnection")) {
     return NS_OK;
   }
   return mProvider->GetDataConnectionInfo(data);
 }
 
 NS_IMETHODIMP
 MobileConnection::GetNetworkSelectionMode(nsAString& networkSelectionMode)
 {
-  if (!mProvider) {
-    networkSelectionMode.SetIsVoid(true);
-    return NS_OK;
+  networkSelectionMode.SetIsVoid(true);
+
+  if (!mProvider || !CheckPermission("mobileconnection")) {
+     return NS_OK;
   }
   return mProvider->GetNetworkSelectionMode(networkSelectionMode);
 }
 
 NS_IMETHODIMP
 MobileConnection::GetIcc(nsIDOMMozIccManager** aIcc)
 {
+  *aIcc = nullptr;
+
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   NS_IF_ADDREF(*aIcc = mIccManager);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 MobileConnection::GetNetworks(nsIDOMDOMRequest** request)
 {
   *request = nullptr;
 
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->GetNetworks(GetOwner(), request);
 }
 
 NS_IMETHODIMP
 MobileConnection::SelectNetwork(nsIDOMMozMobileNetworkInfo* network, nsIDOMDOMRequest** request)
 {
   *request = nullptr;
 
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->SelectNetwork(GetOwner(), network, request);
 }
 
 NS_IMETHODIMP
 MobileConnection::SelectNetworkAutomatically(nsIDOMDOMRequest** request)
 {
   *request = nullptr;
 
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->SelectNetworkAutomatically(GetOwner(), request);
 }
 
 NS_IMETHODIMP
 MobileConnection::GetCardLock(const nsAString& aLockType, nsIDOMDOMRequest** aDomRequest)
 {
   *aDomRequest = nullptr;
 
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->GetCardLock(GetOwner(), aLockType, aDomRequest);
 }
 
 NS_IMETHODIMP
 MobileConnection::UnlockCardLock(const JS::Value& aInfo,
                                  nsIDOMDOMRequest** aDomRequest)
 {
   *aDomRequest = nullptr;
 
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->UnlockCardLock(GetOwner(), aInfo, aDomRequest);
 }
 
 NS_IMETHODIMP
 MobileConnection::SetCardLock(const JS::Value& aInfo,
                               nsIDOMDOMRequest** aDomRequest)
 {
   *aDomRequest = nullptr;
 
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->SetCardLock(GetOwner(), aInfo, aDomRequest);
 }
 
 NS_IMETHODIMP
 MobileConnection::SendMMI(const nsAString& aMMIString,
                           nsIDOMDOMRequest** request)
 {
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->SendMMI(GetOwner(), aMMIString, request);
 }
 
 NS_IMETHODIMP
 MobileConnection::CancelMMI(nsIDOMDOMRequest** request)
 {
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->CancelMMI(GetOwner(), request);
 }
 
 NS_IMETHODIMP
 MobileConnection::GetCallForwardingOption(uint16_t aReason,
                                           nsIDOMDOMRequest** aRequest)
 {
   *aRequest = nullptr;
 
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->GetCallForwardingOption(GetOwner(), aReason, aRequest);
 }
 
 NS_IMETHODIMP
 MobileConnection::SetCallForwardingOption(nsIDOMMozMobileCFInfo* aCFInfo,
                                           nsIDOMDOMRequest** aRequest)
 {
   *aRequest = nullptr;
 
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->SetCallForwardingOption(GetOwner(), aCFInfo, aRequest);
 }
 
 NS_IMETHODIMP
 MobileConnection::GetCallWaitingOption(nsIDOMDOMRequest** aRequest)
 {
   *aRequest = nullptr;
 
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->GetCallWaitingOption(GetOwner(), aRequest);
 }
 
 NS_IMETHODIMP
 MobileConnection::SetCallWaitingOption(bool aEnabled,
                                        nsIDOMDOMRequest** aRequest)
 {
   *aRequest = nullptr;
 
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   if (!mProvider) {
     return NS_ERROR_FAILURE;
   }
 
   return mProvider->SetCallWaitingOption(GetOwner(), aEnabled, aRequest);
 }
 
 // nsIMobileConnectionListener
 
 NS_IMETHODIMP
 MobileConnection::NotifyVoiceChanged()
 {
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   return DispatchTrustedEvent(NS_LITERAL_STRING("voicechange"));
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyDataChanged()
 {
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   return DispatchTrustedEvent(NS_LITERAL_STRING("datachange"));
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyCardStateChanged()
 {
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   return DispatchTrustedEvent(NS_LITERAL_STRING("cardstatechange"));
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyIccInfoChanged()
 {
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   return DispatchTrustedEvent(NS_LITERAL_STRING("iccinfochange"));
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyUssdReceived(const nsAString& aMessage,
                                      bool aSessionEnded)
 {
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   nsCOMPtr<nsIDOMEvent> event;
   NS_NewDOMUSSDReceivedEvent(getter_AddRefs(event), this, nullptr, nullptr);
 
   nsCOMPtr<nsIDOMUSSDReceivedEvent> ce = do_QueryInterface(event);
   nsresult rv = ce->InitUSSDReceivedEvent(NS_LITERAL_STRING("ussdreceived"),
                                           false, false,
                                           aMessage, aSessionEnded);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return DispatchTrustedEvent(ce);
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyDataError(const nsAString& aMessage)
 {
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   nsCOMPtr<nsIDOMEvent> event;
   NS_NewDOMDataErrorEvent(getter_AddRefs(event), this, nullptr, nullptr);
 
   nsCOMPtr<nsIDOMDataErrorEvent> ce = do_QueryInterface(event);
   nsresult rv = ce->InitDataErrorEvent(NS_LITERAL_STRING("dataerror"),
                                        false, false, aMessage);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return DispatchTrustedEvent(ce);
 }
 
 NS_IMETHODIMP
 MobileConnection::NotifyIccCardLockError(const nsAString& aLockType,
                                          uint32_t aRetryCount)
 {
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   nsCOMPtr<nsIDOMEvent> event;
   NS_NewDOMICCCardLockErrorEvent(getter_AddRefs(event), this, nullptr, nullptr);
 
   nsCOMPtr<nsIDOMICCCardLockErrorEvent> ce = do_QueryInterface(event);
   nsresult rv =
     ce->InitICCCardLockErrorEvent(NS_LITERAL_STRING("icccardlockerror"),
                                   false, false, aLockType, aRetryCount);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -400,16 +539,20 @@ MobileConnection::NotifyIccCardLockError
 NS_IMETHODIMP
 MobileConnection::NotifyCFStateChange(bool aSuccess,
                                       unsigned short aAction,
                                       unsigned short aReason,
                                       const nsAString& aNumber,
                                       unsigned short aSeconds,
                                       unsigned short aServiceClass)
 {
+  if (!CheckPermission("mobileconnection")) {
+    return NS_OK;
+  }
+
   nsCOMPtr<nsIDOMEvent> event;
   NS_NewDOMCFStateChangeEvent(getter_AddRefs(event), this, nullptr, nullptr);
 
   nsCOMPtr<nsIDOMCFStateChangeEvent> ce = do_QueryInterface(event);
   nsresult rv = ce->InitCFStateChangeEvent(NS_LITERAL_STRING("cfstatechange"),
                                            false, false,
                                            aSuccess, aAction, aReason, aNumber,
                                            aSeconds, aServiceClass);
--- a/dom/network/src/MobileConnection.h
+++ b/dom/network/src/MobileConnection.h
@@ -46,15 +46,18 @@ public:
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MobileConnection,
                                            nsDOMEventTargetHelper)
 
 private:
   nsCOMPtr<nsIMobileConnectionProvider> mProvider;
   nsRefPtr<Listener> mListener;
   nsRefPtr<icc::IccManager> mIccManager;
+  nsWeakPtr mWindow;
+
+  bool CheckPermission(const char* type);
 };
 
 } // namespace network
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_network_MobileConnection_h
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -253,17 +253,18 @@ function RadioInterfaceLayer() {
                      lastKnownMcc: null,
                      cell: null,
                      type: null,
                      signalStrength: null,
                      relSignalStrength: null},
   };
 
   try {
-    this.rilContext.voice.lastKnownMcc = Services.prefs.getCharPref("ril.lastKnownMcc");
+    this.rilContext.voice.lastKnownMcc =
+      Services.prefs.getCharPref("ril.lastKnownMcc");
   } catch (e) {}
 
   this.voicemailInfo = {
     number: null,
     displayName: null
   };
 
   // Read the 'ril.radio.disabled' setting in order to start with a known
@@ -1075,16 +1076,24 @@ RadioInterfaceLayer.prototype = {
         // !voice.network is in case voice.network is still null.
         if (!voice.network || voice.network.mcc != message.mcc) {
           try {
             Services.prefs.setCharPref("ril.lastKnownMcc", message.mcc);
           } catch (e) {}
         }
       }
 
+      // Update lastKnownNetwork
+      if (message.mcc && message.mnc) {
+        try {
+          Services.prefs.setCharPref("ril.lastKnownNetwork",
+                                     message.mcc + "-" + message.mnc);
+        } catch (e) {}
+      }
+
       voice.network = message;
       if (!message.batch) {
         this._sendMobileConnectionMessage("RIL:VoiceInfoChanged", voice);
       }
     }
 
     if (this.networkChanged(message, data.network)) {
       data.network = message;
@@ -1784,16 +1793,24 @@ RadioInterfaceLayer.prototype = {
                           oldIccInfo.msisdn != message.msisdn;
     if (!iccInfoChanged) {
       return;
     }
     // RIL:IccInfoChanged corresponds to a DOM event that gets fired only
     // when the MCC or MNC codes have changed.
     this._sendMobileConnectionMessage("RIL:IccInfoChanged", message);
 
+    // Update lastKnownHomeNetwork.
+    if (message.mcc && message.mnc) {
+      try {
+        Services.prefs.setCharPref("ril.lastKnownHomeNetwork",
+                                   message.mcc + "-" + message.mnc);
+      } catch (e) {}
+    }
+
     // If spn becomes available, we should check roaming again.
     let oldSpn = oldIccInfo ? oldIccInfo.spn : null;
     if (!oldSpn && message.spn) {
       let voice = this.rilContext.voice;
       let data = this.rilContext.data;
       let voiceRoaming = voice.roaming;
       let dataRoaming = data.roaming;
       this.checkRoamingBetweenOperators(voice);