summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2018-04-02 14:23:38 -0700
committerCopybara-Service <copybara-piper@google.com>2018-04-02 14:46:41 -0700
commita462370fa5d9517c6dc0dee92a10e4231b46f43c (patch)
treec5a7ad1480d25de3a3841584fe52e2cad3816852 /java
parentaf8399ee0698fb82ac6f6f9d770a8ea047c633fb (diff)
Fix the bug that number format is not correct in RTL mode.
Bug: 76227259 Test: manual PiperOrigin-RevId: 191347301 Change-Id: I18d63f4e85ca07be00f7564a5ee256d3a6b1b480
Diffstat (limited to 'java')
-rw-r--r--java/com/android/incallui/CallCardPresenter.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java
index 2f88c8836..1f7a0d396 100644
--- a/java/com/android/incallui/CallCardPresenter.java
+++ b/java/com/android/incallui/CallCardPresenter.java
@@ -36,6 +36,8 @@ import android.support.v4.content.ContextCompat;
import android.telecom.Call.Details;
import android.telecom.StatusHints;
import android.telecom.TelecomManager;
+import android.text.BidiFormatter;
+import android.text.TextDirectionHeuristics;
import android.text.TextUtils;
import android.view.Display;
import android.view.View;
@@ -987,7 +989,10 @@ public class CallCardPresenter
ContactDisplayUtils.getPreferredDisplayName(
contactInfo.namePrimary, contactInfo.nameAlternative, contactsPreferences);
if (TextUtils.isEmpty(preferredName)) {
- return contactInfo.number;
+ return TextUtils.isEmpty(contactInfo.number)
+ ? null
+ : BidiFormatter.getInstance()
+ .unicodeWrap(contactInfo.number, TextDirectionHeuristics.LTR);
}
return preferredName;
}