Implement getNetworkCountryIso in PhoneInterfaceManager.

This moves the implementation from TelephonyManager into
PhoneInterfaceManager so that we can perform an additional IWLAN check.

Bug: 63050313
Test: no compilation errors
Merged-In: I69a36d085f5cca13a225d8e15ff521b4017ba1ab
Change-Id: I69a36d085f5cca13a225d8e15ff521b4017ba1ab
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 4b43ac4..24ffc0b 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -97,6 +97,7 @@
 import com.android.internal.telephony.RIL;
 import com.android.internal.telephony.RILConstants;
 import com.android.internal.telephony.SubscriptionController;
+import com.android.internal.telephony.TelephonyProperties;
 import com.android.internal.telephony.euicc.EuiccConnector;
 import com.android.internal.telephony.uicc.IccIoResult;
 import com.android.internal.telephony.uicc.IccUtils;
@@ -1682,6 +1683,24 @@
 
 
     @Override
+    public String getNetworkCountryIsoForPhone(int phoneId) {
+        // Reporting the correct network country is ambiguous when IWLAN could conflict with
+        // registered cell info, so return a NULL country instead.
+        final long identity = Binder.clearCallingIdentity();
+        try {
+            final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
+            if (TelephonyManager.NETWORK_TYPE_IWLAN
+                    == getVoiceNetworkTypeForSubscriber(subId, mApp.getPackageName())) {
+                return "";
+            }
+        } finally {
+            Binder.restoreCallingIdentity(identity);
+        }
+        return TelephonyManager.getTelephonyProperty(
+                phoneId, TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY, "");
+    }
+
+    @Override
     public void enableLocationUpdates() {
         enableLocationUpdatesForSubscriber(getDefaultSubscription());
     }