Removing contacts dependencies from CallDetailActivity.

Bug: 6993891
Change-Id: I3ef54efc0ff92367ea4f9b68c1629a99d90ff22c
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index cadbb6b..d716de0 100644
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -51,11 +51,10 @@
 import android.widget.TextView;
 import android.widget.Toast;
 
+import com.android.contacts.common.ContactPhotoManager;
 import com.android.contacts.common.CallUtil;
-import com.android.contacts.ContactPhotoManager;
-import com.android.contacts.ContactsUtils;
-import com.android.contacts.format.FormatUtils;
 import com.android.contacts.common.ClipboardUtils;
+import com.android.contacts.common.GeoUtil;
 import com.android.dialer.BackScrollManager.ScrollableHeader;
 import com.android.dialer.calllog.CallDetailHistoryAdapter;
 import com.android.dialer.calllog.CallTypeHelper;
@@ -80,6 +79,9 @@
 public class CallDetailActivity extends Activity implements ProximitySensorAware {
     private static final String TAG = "CallDetail";
 
+    private static final char LEFT_TO_RIGHT_EMBEDDING = '\u202A';
+    private static final char POP_DIRECTIONAL_FORMATTING = '\u202C';
+
     /** The time to wait before enabling the blank the screen due to the proximity sensor. */
     private static final long PROXIMITY_BLANK_DELAY_MILLIS = 100;
     /** The time to wait before disabling the blank the screen due to the proximity sensor. */
@@ -271,10 +273,10 @@
         mMainActionView = (ImageView) findViewById(R.id.main_action);
         mMainActionPushLayerView = (ImageButton) findViewById(R.id.main_action_push_layer);
         mContactBackgroundView = (ImageView) findViewById(R.id.contact_background);
-        mDefaultCountryIso = ContactsUtils.getCurrentCountryIso(this);
+        mDefaultCountryIso = GeoUtil.getCurrentCountryIso(this);
         mContactPhotoManager = ContactPhotoManager.getInstance(this);
         mProximitySensorManager = new ProximitySensorManager(this, mProximitySensorListener);
-        mContactInfoHelper = new ContactInfoHelper(this, ContactsUtils.getCurrentCountryIso(this));
+        mContactInfoHelper = new ContactInfoHelper(this, GeoUtil.getCurrentCountryIso(this));
         configureActionBar();
         optionallyHandleVoicemail();
         if (getIntent().getBooleanExtra(EXTRA_FROM_NOTIFICATION, false)) {
@@ -511,7 +513,7 @@
 
                     ViewEntry entry = new ViewEntry(
                             getString(R.string.menu_callNumber,
-                                    FormatUtils.forceLeftToRight(displayNumber)),
+                                    forceLeftToRight(displayNumber)),
                                     CallUtil.getCallIntent(mNumber),
                                     getString(R.string.description_call, nameOrNumber));
 
@@ -935,4 +937,13 @@
             mTargetView.setBackground(mOriginalViewBackground);
         }
     }
+
+    /** Returns the given text, forced to be left-to-right. */
+    private static CharSequence forceLeftToRight(CharSequence text) {
+        StringBuilder sb = new StringBuilder();
+        sb.append(LEFT_TO_RIGHT_EMBEDDING);
+        sb.append(text);
+        sb.append(POP_DIRECTIONAL_FORMATTING);
+        return sb.toString();
+    }
 }