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
Change-Id: I69a36d085f5cca13a225d8e15ff521b4017ba1ab
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index b7c913c..01de5d8 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -92,6 +92,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.uicc.IccIoResult;
 import com.android.internal.telephony.uicc.IccUtils;
 import com.android.internal.telephony.uicc.SIMRecords;
@@ -1635,6 +1636,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(subId);
+            if (TelephonyManager.NETWORK_TYPE_IWLAN
+                    == getVoiceNetworkType(subId, mApp.getPackageName())) {
+                return "";
+            }
+        } finally {
+            Binder.restoreCallingIdentity(identity);
+        }
+        return TelephonyManager.getTelephonyProperty(
+                phoneId, TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY, "");
+    }
+
     private void enforceFineOrCoarseLocationPermission(String message) {
         try {
             mApp.enforceCallingOrSelfPermission(