diff --git a/java/com/android/dialer/telecom/TelecomCallUtil.java b/java/com/android/dialer/telecom/TelecomCallUtil.java
new file mode 100644
index 0000000..acec498
--- /dev/null
+++ b/java/com/android/dialer/telecom/TelecomCallUtil.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.dialer.telecom;
+
+import android.content.Context;
+import android.net.Uri;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.annotation.WorkerThread;
+import android.telecom.Call;
+import android.telecom.PhoneAccountHandle;
+import android.telephony.PhoneNumberUtils;
+import android.telephony.SubscriptionInfo;
+import android.text.TextUtils;
+import com.android.dialer.common.Assert;
+import com.android.dialer.common.LogUtil;
+import com.google.common.base.Optional;
+import java.util.Locale;
+
+/**
+ * Class to provide a standard interface for obtaining information from the underlying
+ * android.telecom.Call. Much of this should be obtained through the incall.Call, but on occasion we
+ * need to interact with the telecom.Call directly (eg. call blocking, before the incall.Call has
+ * been created).
+ */
+public class TelecomCallUtil {
+
+  /** Returns Whether the call handle is an emergency number. */
+  public static boolean isEmergencyCall(@NonNull Call call) {
+    Assert.isNotNull(call);
+    Uri handle = call.getDetails().getHandle();
+    return PhoneNumberUtils.isEmergencyNumber(handle == null ? "" : handle.getSchemeSpecificPart());
+  }
+
+  /**
+   * Returns The phone number which the {@code Call} is currently connected, or {@code null} if the
+   * number is not available.
+   */
+  @Nullable
+  public static String getNumber(@Nullable Call call) {
+    if (call == null) {
+      return null;
+    }
+    if (call.getDetails().getGatewayInfo() != null) {
+      return call.getDetails().getGatewayInfo().getOriginalAddress().getSchemeSpecificPart();
+    }
+    Uri handle = getHandle(call);
+    return handle == null ? null : handle.getSchemeSpecificPart();
+  }
+
+  /**
+   * Returns The handle (e.g., phone number) to which the {@code Call} is currently connected, or
+   * {@code null} if the number is not available.
+   */
+  @Nullable
+  public static Uri getHandle(@Nullable Call call) {
+    return call == null ? null : call.getDetails().getHandle();
+  }
+
+  /**
+   * Normalizes the number of the {@code call} to E.164. If the country code is missing in the
+   * number the SIM's country will be used. Only removes non-dialable digits if the country code is
+   * missing.
+   */
+  @WorkerThread
+  public static Optional<String> getNormalizedNumber(Context appContext, Call call) {
+    Assert.isWorkerThread();
+    PhoneAccountHandle phoneAccountHandle = call.getDetails().getAccountHandle();
+    Optional<SubscriptionInfo> subscriptionInfo =
+        TelecomUtil.getSubscriptionInfo(appContext, phoneAccountHandle);
+    String rawNumber = getNumber(call);
+    if (TextUtils.isEmpty(rawNumber)) {
+      return Optional.absent();
+    }
+    String normalizedNumber = PhoneNumberUtils.normalizeNumber(rawNumber);
+    if (TextUtils.isEmpty(normalizedNumber)) {
+      return Optional.absent();
+    }
+    String countryCode =
+        subscriptionInfo.isPresent() ? subscriptionInfo.get().getCountryIso() : null;
+    if (countryCode == null) {
+      LogUtil.w(
+          "PhoneLookupHistoryRecorder.getNormalizedNumber",
+          "couldn't find a country code for call");
+      return Optional.of(normalizedNumber);
+    }
+
+    String e164Number =
+        PhoneNumberUtils.formatNumberToE164(rawNumber, countryCode.toUpperCase(Locale.US));
+    return e164Number == null ? Optional.of(normalizedNumber) : Optional.of(e164Number);
+  }
+}
diff --git a/java/com/android/incallui/ExternalCallNotifier.java b/java/com/android/incallui/ExternalCallNotifier.java
index 9e78052..7915b85 100644
--- a/java/com/android/incallui/ExternalCallNotifier.java
+++ b/java/com/android/incallui/ExternalCallNotifier.java
@@ -44,11 +44,11 @@
 import com.android.dialer.contactphoto.BitmapUtil;
 import com.android.dialer.notification.DialerNotificationManager;
 import com.android.dialer.notification.NotificationChannelId;
+import com.android.dialer.telecom.TelecomCallUtil;
 import com.android.incallui.call.DialerCall;
 import com.android.incallui.call.DialerCallDelegate;
 import com.android.incallui.call.ExternalCallList;
 import com.android.incallui.latencyreport.LatencyReport;
-import com.android.incallui.util.TelecomCallUtil;
 import java.util.Map;
 
 /**
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java
index f8605ae..3debd70 100644
--- a/java/com/android/incallui/InCallPresenter.java
+++ b/java/com/android/incallui/InCallPresenter.java
@@ -52,6 +52,7 @@
 import com.android.dialer.logging.InteractionEvent;
 import com.android.dialer.logging.Logger;
 import com.android.dialer.postcall.PostCall;
+import com.android.dialer.telecom.TelecomCallUtil;
 import com.android.dialer.telecom.TelecomUtil;
 import com.android.dialer.util.TouchPointManager;
 import com.android.incallui.InCallOrientationEventListener.ScreenOrientation;
@@ -66,7 +67,6 @@
 import com.android.incallui.latencyreport.LatencyReport;
 import com.android.incallui.legacyblocking.BlockedNumberContentObserver;
 import com.android.incallui.spam.SpamCallListListener;
-import com.android.incallui.util.TelecomCallUtil;
 import com.android.incallui.videosurface.bindings.VideoSurfaceBindings;
 import com.android.incallui.videosurface.protocol.VideoSurfaceTexture;
 import com.android.incallui.videotech.utils.VideoUtils;
@@ -213,7 +213,7 @@
           }
         }
       };
-  
+
   /** Whether or not InCallService is bound to Telecom. */
   private boolean mServiceBound = false;
 
diff --git a/java/com/android/incallui/PhoneLookupHistoryRecorder.java b/java/com/android/incallui/PhoneLookupHistoryRecorder.java
index 2632e65..667c0d1 100644
--- a/java/com/android/incallui/PhoneLookupHistoryRecorder.java
+++ b/java/com/android/incallui/PhoneLookupHistoryRecorder.java
@@ -19,25 +19,18 @@
 import android.content.Context;
 import android.support.annotation.Nullable;
 import android.telecom.Call;
-import android.telecom.PhoneAccountHandle;
-import android.telephony.PhoneNumberUtils;
-import android.telephony.SubscriptionInfo;
-import android.text.TextUtils;
 import com.android.dialer.buildtype.BuildType;
 import com.android.dialer.common.Assert;
 import com.android.dialer.common.LogUtil;
 import com.android.dialer.common.concurrent.DialerExecutors;
-import com.android.dialer.location.CountryDetector;
 import com.android.dialer.phonelookup.PhoneLookupComponent;
 import com.android.dialer.phonelookup.PhoneLookupInfo;
 import com.android.dialer.phonelookup.database.contract.PhoneLookupHistoryContract.PhoneLookupHistory;
-import com.android.dialer.telecom.TelecomUtil;
-import com.android.incallui.util.TelecomCallUtil;
+import com.android.dialer.telecom.TelecomCallUtil;
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-import java.util.Locale;
 
 /**
  * Fetches the current {@link PhoneLookupInfo} for the provided call and writes it to the
@@ -61,7 +54,8 @@
           @Override
           public void onSuccess(@Nullable PhoneLookupInfo result) {
             Assert.checkArgument(result != null);
-            Optional<String> normalizedNumber = getNormalizedNumber(appContext, call);
+            Optional<String> normalizedNumber =
+                TelecomCallUtil.getNormalizedNumber(appContext, call);
             if (!normalizedNumber.isPresent()) {
               LogUtil.w("PhoneLookupHistoryRecorder.onSuccess", "couldn't get a number");
               return;
@@ -90,27 +84,4 @@
         },
         DialerExecutors.getLowPriorityThreadPool(appContext));
   }
-
-  private static Optional<String> getNormalizedNumber(Context appContext, Call call) {
-    PhoneAccountHandle phoneAccountHandle = call.getDetails().getAccountHandle();
-    Optional<SubscriptionInfo> subscriptionInfo =
-        TelecomUtil.getSubscriptionInfo(appContext, phoneAccountHandle);
-    String countryCode =
-        subscriptionInfo.isPresent()
-            ? subscriptionInfo.get().getCountryIso()
-            : CountryDetector.getInstance(appContext).getCurrentCountryIso();
-    if (countryCode == null) {
-      LogUtil.w(
-          "PhoneLookupHistoryRecorder.getNormalizedNumber",
-          "couldn't find a country code for call");
-      countryCode = "US";
-    }
-    String rawNumber = TelecomCallUtil.getNumber(call);
-    if (TextUtils.isEmpty(rawNumber)) {
-      return Optional.absent();
-    }
-    String normalizedNumber =
-        PhoneNumberUtils.formatNumberToE164(rawNumber, countryCode.toUpperCase(Locale.US));
-    return normalizedNumber == null ? Optional.of(rawNumber) : Optional.of(normalizedNumber);
-  }
 }
diff --git a/java/com/android/incallui/call/CallList.java b/java/com/android/incallui/call/CallList.java
index d2ac483..150b20e 100644
--- a/java/com/android/incallui/call/CallList.java
+++ b/java/com/android/incallui/call/CallList.java
@@ -40,9 +40,9 @@
 import com.android.dialer.shortcuts.ShortcutUsageReporter;
 import com.android.dialer.spam.Spam;
 import com.android.dialer.spam.SpamComponent;
+import com.android.dialer.telecom.TelecomCallUtil;
 import com.android.incallui.call.DialerCall.State;
 import com.android.incallui.latencyreport.LatencyReport;
-import com.android.incallui.util.TelecomCallUtil;
 import com.android.incallui.videotech.utils.SessionModificationState;
 import java.util.Collection;
 import java.util.Collections;
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java
index e8523d6..8120249 100644
--- a/java/com/android/incallui/call/DialerCall.java
+++ b/java/com/android/incallui/call/DialerCall.java
@@ -64,12 +64,12 @@
 import com.android.dialer.logging.ContactLookupResult.Type;
 import com.android.dialer.logging.DialerImpression;
 import com.android.dialer.logging.Logger;
+import com.android.dialer.telecom.TelecomCallUtil;
 import com.android.dialer.telecom.TelecomUtil;
 import com.android.dialer.theme.R;
 import com.android.dialer.util.PermissionsUtil;
 import com.android.incallui.audiomode.AudioModeProvider;
 import com.android.incallui.latencyreport.LatencyReport;
-import com.android.incallui.util.TelecomCallUtil;
 import com.android.incallui.videotech.VideoTech;
 import com.android.incallui.videotech.VideoTech.VideoTechListener;
 import com.android.incallui.videotech.duo.DuoVideoTech;
diff --git a/java/com/android/incallui/util/TelecomCallUtil.java b/java/com/android/incallui/util/TelecomCallUtil.java
deleted file mode 100644
index 8855543..0000000
--- a/java/com/android/incallui/util/TelecomCallUtil.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.incallui.util;
-
-import android.net.Uri;
-import android.telecom.Call;
-import android.telephony.PhoneNumberUtils;
-
-/**
- * Class to provide a standard interface for obtaining information from the underlying
- * android.telecom.Call. Much of this should be obtained through the incall.Call, but on occasion we
- * need to interact with the telecom.Call directly (eg. call blocking, before the incall.Call has
- * been created).
- */
-public class TelecomCallUtil {
-
-  // Whether the call handle is an emergency number.
-  public static boolean isEmergencyCall(Call call) {
-    Uri handle = call.getDetails().getHandle();
-    return PhoneNumberUtils.isEmergencyNumber(handle == null ? "" : handle.getSchemeSpecificPart());
-  }
-
-  public static String getNumber(Call call) {
-    if (call == null) {
-      return null;
-    }
-    if (call.getDetails().getGatewayInfo() != null) {
-      return call.getDetails().getGatewayInfo().getOriginalAddress().getSchemeSpecificPart();
-    }
-    Uri handle = getHandle(call);
-    return handle == null ? null : handle.getSchemeSpecificPart();
-  }
-
-  public static Uri getHandle(Call call) {
-    return call == null ? null : call.getDetails().getHandle();
-  }
-}
