diff --git a/java/com/android/contacts/common/list/PhoneNumberListAdapter.java b/java/com/android/contacts/common/list/PhoneNumberListAdapter.java
index 71d9dad..741e606 100644
--- a/java/com/android/contacts/common/list/PhoneNumberListAdapter.java
+++ b/java/com/android/contacts/common/list/PhoneNumberListAdapter.java
@@ -381,7 +381,11 @@
         text = phoneLabel;
       } else {
         final String phoneNumber = cursor.getString(PhoneQuery.PHONE_NUMBER);
-        text = PhoneNumberHelper.getGeoDescription(mContext, phoneNumber);
+        text =
+            PhoneNumberHelper.getGeoDescription(
+                mContext,
+                phoneNumber,
+                PhoneNumberHelper.getCurrentCountryIso(mContext, null /* PhoneAccountHandle */));
       }
     }
     view.setPhoneNumber(text);
diff --git a/java/com/android/dialer/app/filterednumber/NumbersAdapter.java b/java/com/android/dialer/app/filterednumber/NumbersAdapter.java
index 938a784..bdd6dce 100644
--- a/java/com/android/dialer/app/filterednumber/NumbersAdapter.java
+++ b/java/com/android/dialer/app/filterednumber/NumbersAdapter.java
@@ -72,7 +72,7 @@
       info = new ContactInfo();
       info.number = number;
     }
-    final CharSequence locationOrType = getNumberTypeOrLocation(info);
+    final CharSequence locationOrType = getNumberTypeOrLocation(info, countryIso);
     final String displayNumber = getDisplayNumber(info);
     final String displayNumberStr =
         mBidiFormatter.unicodeWrap(displayNumber, TextDirectionHeuristics.LTR);
@@ -121,12 +121,12 @@
     }
   }
 
-  private CharSequence getNumberTypeOrLocation(ContactInfo info) {
+  private CharSequence getNumberTypeOrLocation(ContactInfo info, String countryIso) {
     if (!TextUtils.isEmpty(info.name)) {
       return ContactsContract.CommonDataKinds.Phone.getTypeLabel(
           mContext.getResources(), info.type, info.label);
     } else {
-      return PhoneNumberHelper.getGeoDescription(mContext, info.number);
+      return PhoneNumberHelper.getGeoDescription(mContext, info.number, countryIso);
     }
   }
 
diff --git a/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java b/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java
index db1dd4a..ecd36d3 100644
--- a/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java
+++ b/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java
@@ -198,4 +198,34 @@
       context.sendBroadcast(intent);
     }
   }
+
+  /**
+   * Returns network country iso for given {@code PhoneAccountHandle} for O+ devices and country iso
+   * for default sim for pre-O devices.
+   */
+  public static String getNetworkCountryIsoForPhoneAccountHandle(
+      Context context, @Nullable PhoneAccountHandle phoneAccountHandle) {
+    return getTelephonyManagerForPhoneAccountHandle(context, phoneAccountHandle)
+        .getNetworkCountryIso();
+  }
+
+  /**
+   * Returns TelephonyManager for given {@code PhoneAccountHandle} for O+ devices and default {@code
+   * TelephonyManager} for pre-O devices.
+   */
+  public static TelephonyManager getTelephonyManagerForPhoneAccountHandle(
+      Context context, @Nullable PhoneAccountHandle phoneAccountHandle) {
+    TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class);
+    if (phoneAccountHandle == null) {
+      return telephonyManager;
+    }
+    if (VERSION.SDK_INT >= VERSION_CODES.O) {
+      TelephonyManager telephonyManagerForPhoneAccount =
+          telephonyManager.createForPhoneAccountHandle(phoneAccountHandle);
+      if (telephonyManagerForPhoneAccount != null) {
+        return telephonyManagerForPhoneAccount;
+      }
+    }
+    return telephonyManager;
+  }
 }
diff --git a/java/com/android/dialer/phonenumbergeoutil/PhoneNumberGeoUtil.java b/java/com/android/dialer/phonenumbergeoutil/PhoneNumberGeoUtil.java
index 2005abc..7e45598 100644
--- a/java/com/android/dialer/phonenumbergeoutil/PhoneNumberGeoUtil.java
+++ b/java/com/android/dialer/phonenumbergeoutil/PhoneNumberGeoUtil.java
@@ -20,5 +20,6 @@
 
 /** Interface for getting geo information for phone number. */
 public interface PhoneNumberGeoUtil {
-  String getGeoDescription(Context context, String number);
+  /** Returns geo location information for a phone number, e.g. California. */
+  String getGeoDescription(Context context, String number, String countryIso);
 }
diff --git a/java/com/android/dialer/phonenumbergeoutil/impl/PhoneNumberGeoUtilImpl.java b/java/com/android/dialer/phonenumbergeoutil/impl/PhoneNumberGeoUtilImpl.java
index 32f6592..fb28ed5 100644
--- a/java/com/android/dialer/phonenumbergeoutil/impl/PhoneNumberGeoUtilImpl.java
+++ b/java/com/android/dialer/phonenumbergeoutil/impl/PhoneNumberGeoUtilImpl.java
@@ -21,7 +21,6 @@
 import com.android.dialer.common.LogUtil;
 import com.android.dialer.compat.CompatUtils;
 import com.android.dialer.phonenumbergeoutil.PhoneNumberGeoUtil;
-import com.android.dialer.phonenumberutil.PhoneNumberHelper;
 import com.google.i18n.phonenumbers.NumberParseException;
 import com.google.i18n.phonenumbers.PhoneNumberUtil;
 import com.google.i18n.phonenumbers.Phonenumber;
@@ -36,7 +35,7 @@
   public PhoneNumberGeoUtilImpl() {}
 
   @Override
-  public String getGeoDescription(Context context, String number) {
+  public String getGeoDescription(Context context, String number, String countryIso) {
     LogUtil.v("PhoneNumberGeoUtilImpl.getGeoDescription", "" + LogUtil.sanitizePii(number));
 
     if (TextUtils.isEmpty(number)) {
@@ -47,7 +46,6 @@
     PhoneNumberOfflineGeocoder geocoder = PhoneNumberOfflineGeocoder.getInstance();
 
     Locale locale = CompatUtils.getLocale(context);
-    String countryIso = PhoneNumberHelper.getCurrentCountryIso(context, locale);
     Phonenumber.PhoneNumber pn = null;
     try {
       LogUtil.v(
diff --git a/java/com/android/dialer/phonenumbergeoutil/stub/PhoneNumberGeoUtilStub.java b/java/com/android/dialer/phonenumbergeoutil/stub/PhoneNumberGeoUtilStub.java
index 4c5b3b0..06cd137 100644
--- a/java/com/android/dialer/phonenumbergeoutil/stub/PhoneNumberGeoUtilStub.java
+++ b/java/com/android/dialer/phonenumbergeoutil/stub/PhoneNumberGeoUtilStub.java
@@ -26,7 +26,7 @@
   public PhoneNumberGeoUtilStub() {}
 
   @Override
-  public String getGeoDescription(Context context, String number) {
+  public String getGeoDescription(Context context, String number, String countryIso) {
     return null;
   }
 }
diff --git a/java/com/android/dialer/phonenumberutil/PhoneNumberHelper.java b/java/com/android/dialer/phonenumberutil/PhoneNumberHelper.java
index 1189a9b..b25e4d7 100644
--- a/java/com/android/dialer/phonenumberutil/PhoneNumberHelper.java
+++ b/java/com/android/dialer/phonenumberutil/PhoneNumberHelper.java
@@ -24,11 +24,12 @@
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import com.android.dialer.common.LogUtil;
+import com.android.dialer.compat.CompatUtils;
+import com.android.dialer.compat.telephony.TelephonyManagerCompat;
 import com.android.dialer.phonenumbergeoutil.PhoneNumberGeoUtilComponent;
 import com.android.dialer.telecom.TelecomUtil;
 import java.util.Arrays;
 import java.util.HashSet;
-import java.util.Locale;
 import java.util.Set;
 
 public class PhoneNumberHelper {
@@ -92,27 +93,33 @@
   }
 
   /**
+   * @param countryIso Country ISO used if there is no country code in the number, may be null
+   *     otherwise.
    * @return a geographical description string for the specified number.
    */
-  public static String getGeoDescription(Context context, String number) {
+  public static String getGeoDescription(
+      Context context, String number, @Nullable String countryIso) {
     return PhoneNumberGeoUtilComponent.get(context)
         .getPhoneNumberGeoUtil()
-        .getGeoDescription(context, number);
+        .getGeoDescription(context, number, countryIso);
   }
 
   /**
+   * @param phoneAccountHandle {@code PhonAccountHandle} used to get current network country ISO.
+   *     May be null if no account is in use or selected, in which case default account will be
+   *     used.
    * @return The ISO 3166-1 two letters country code of the country the user is in based on the
    *     network location. If the network location does not exist, fall back to the locale setting.
    */
-  public static String getCurrentCountryIso(Context context, Locale locale) {
+  public static String getCurrentCountryIso(
+      Context context, @Nullable PhoneAccountHandle phoneAccountHandle) {
     // Without framework function calls, this seems to be the most accurate location service
     // we can rely on.
-    final TelephonyManager telephonyManager =
-        (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
-
-    String countryIso = telephonyManager.getNetworkCountryIso();
+    String countryIso =
+        TelephonyManagerCompat.getNetworkCountryIsoForPhoneAccountHandle(
+            context, phoneAccountHandle);
     if (TextUtils.isEmpty(countryIso)) {
-      countryIso = locale.getCountry();
+      countryIso = CompatUtils.getLocale(context).getCountry();
       LogUtil.i(
           "PhoneNumberHelper.getCurrentCountryIso",
           "No CountryDetector; falling back to countryIso based on locale: " + countryIso);
@@ -126,14 +133,12 @@
    * @return Formatted phone number. e.g. 1-123-456-7890. Returns the original number if formatting
    *     failed.
    */
-  public static String formatNumber(@Nullable String number, Context context) {
+  public static String formatNumber(@Nullable String number, String countryIso) {
     // The number can be null e.g. schema is voicemail and uri content is empty.
     if (number == null) {
       return null;
     }
-    String formattedNumber =
-        PhoneNumberUtils.formatNumber(
-            number, PhoneNumberHelper.getCurrentCountryIso(context, Locale.getDefault()));
+    String formattedNumber = PhoneNumberUtils.formatNumber(number, countryIso);
     return formattedNumber != null ? formattedNumber : number;
   }
 
diff --git a/java/com/android/incallui/CallerInfo.java b/java/com/android/incallui/CallerInfo.java
index e552d7c..cc1a60a 100644
--- a/java/com/android/incallui/CallerInfo.java
+++ b/java/com/android/incallui/CallerInfo.java
@@ -162,6 +162,8 @@
    */
   public String callSubject;
 
+  public String countryIso;
+
   private boolean mIsEmergency;
   private boolean mIsVoiceMail;
 
@@ -522,7 +524,7 @@
    */
   public void updateGeoDescription(Context context, String fallbackNumber) {
     String number = TextUtils.isEmpty(phoneNumber) ? fallbackNumber : phoneNumber;
-    geoDescription = PhoneNumberHelper.getGeoDescription(context, number);
+    geoDescription = PhoneNumberHelper.getGeoDescription(context, number, countryIso);
   }
 
   /** @return a string debug representation of this instance. */
diff --git a/java/com/android/incallui/CallerInfoAsyncQuery.java b/java/com/android/incallui/CallerInfoAsyncQuery.java
index 858d0f4..86b1b7f 100644
--- a/java/com/android/incallui/CallerInfoAsyncQuery.java
+++ b/java/com/android/incallui/CallerInfoAsyncQuery.java
@@ -162,6 +162,7 @@
     cw.listener = listener;
     cw.cookie = cookie;
     cw.number = info.phoneNumber;
+    cw.countryIso = info.countryIso;
 
     // check to see if these are recognized numbers, and use shortcuts if we can.
     if (PhoneNumberUtils.isLocalEmergencyNumber(context, info.phoneNumber)) {
@@ -268,6 +269,7 @@
     public Object cookie;
     public int event;
     public String number;
+    public String countryIso;
   }
   /* Directory lookup related code - END */
 
@@ -493,6 +495,7 @@
               mCallerInfo = newCallerInfo;
               Log.d(this, "#####async contact look up with numeric username" + mCallerInfo);
             }
+            mCallerInfo.countryIso = cw.countryIso;
 
             // Final step: look up the geocoded description.
             if (ENABLE_UNKNOWN_NUMBER_GEO_DESCRIPTION) {
diff --git a/java/com/android/incallui/CallerInfoUtils.java b/java/com/android/incallui/CallerInfoUtils.java
index 8f23107..bf586f5 100644
--- a/java/com/android/incallui/CallerInfoUtils.java
+++ b/java/com/android/incallui/CallerInfoUtils.java
@@ -70,7 +70,7 @@
             "CallerInfoUtils.getCallerInfoForCall",
             "Actually starting CallerInfoAsyncQuery.startQuery()...");
 
-        //noinspection MissingPermission
+        // noinspection MissingPermission
         CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context, info, listener, cookie);
       } else {
         LogUtil.w(
@@ -93,6 +93,7 @@
     info.namePresentation = call.getCnapNamePresentation();
     info.callSubject = call.getCallSubject();
     info.contactExists = false;
+    info.countryIso = PhoneNumberHelper.getCurrentCountryIso(context, call.getAccountHandle());
 
     String number = call.getNumber();
     if (!TextUtils.isEmpty(number)) {
diff --git a/java/com/android/incallui/ContactInfoCache.java b/java/com/android/incallui/ContactInfoCache.java
index 7bac6d3..39c4c2f 100644
--- a/java/com/android/incallui/ContactInfoCache.java
+++ b/java/com/android/incallui/ContactInfoCache.java
@@ -211,7 +211,7 @@
         // No name, but we do have a valid CNAP name, so use that.
         displayName = info.cnapName;
         info.name = info.cnapName;
-        displayNumber = PhoneNumberHelper.formatNumber(number, context);
+        displayNumber = PhoneNumberHelper.formatNumber(number, info.countryIso);
         Log.d(
             TAG,
             "  ==> cnapName available: displayName '"
@@ -224,7 +224,7 @@
         // case when an incoming call doesn't match any contact,
         // or if you manually dial an outgoing number using the
         // dialpad.
-        displayNumber = PhoneNumberHelper.formatNumber(number, context);
+        displayNumber = PhoneNumberHelper.formatNumber(number, info.countryIso);
 
         Log.d(
             TAG,
@@ -249,7 +249,7 @@
         // later determine whether to use the name or nameAlternative when presenting
         displayName = info.name;
         cce.nameAlternative = info.nameAlternative;
-        displayNumber = PhoneNumberHelper.formatNumber(number, context);
+        displayNumber = PhoneNumberHelper.formatNumber(number, info.countryIso);
         label = info.phoneLabel;
         Log.d(
             TAG,
