From 9f1caf18bf3daf34bb1724998bae5e0fce385b61 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 5 Jun 2015 11:09:06 -0700 Subject: Bidiformat number to force to LTR. Bug: 20981731 Change-Id: I659903305475691e241955555494b2596846af6f --- src/com/android/dialer/list/DialerPhoneNumberListAdapter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java index 8a4302319..17c573f1c 100644 --- a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java +++ b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java @@ -3,6 +3,8 @@ package com.android.dialer.list; import android.content.Context; import android.content.res.Resources; import android.telephony.PhoneNumberUtils; +import android.text.BidiFormatter; +import android.text.TextDirectionHeuristics; import android.view.View; import android.view.ViewGroup; @@ -36,6 +38,8 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { private final boolean[] mShortcutEnabled = new boolean[SHORTCUT_COUNT]; + private final BidiFormatter mBidiFormatter = BidiFormatter.getInstance(); + public DialerPhoneNumberListAdapter(Context context) { super(context); @@ -141,7 +145,9 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { final String number = getFormattedQueryString(); switch (shortcutType) { case SHORTCUT_DIRECT_CALL: - text = resources.getString(R.string.search_shortcut_call_number, number); + text = resources.getString( + R.string.search_shortcut_call_number, + mBidiFormatter.unicodeWrap(number, TextDirectionHeuristics.LTR)); drawableId = R.drawable.ic_search_phone; break; case SHORTCUT_CREATE_NEW_CONTACT: -- cgit v1.2.3