aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2014-05-01 15:41:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-01 15:41:13 +0000
commit6f699fcf414c6e50aa5cf473d32b76c81b666bf6 (patch)
tree4e0a69499401535ede98f88eeaa504da99847ae5
parenta45ddc61054ea75f50c120b254854fa8135096af (diff)
parent8697e0eb16fd00420efaf626ba4da3d548de3b59 (diff)
downloadtelephony-idea133-weekly-release.tar.gz
Merge "Fix order of '+' in call forwarding return result in RTL locales"idea133-weekly-release
-rw-r--r--src/java/com/android/internal/telephony/gsm/GsmMmiCode.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
index c2bafbe442..7927c822d3 100644
--- a/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
+++ b/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
@@ -26,6 +26,8 @@ import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
import android.os.*;
import android.telephony.PhoneNumberUtils;
import android.text.SpannableStringBuilder;
+import android.text.BidiFormatter;
+import android.text.TextDirectionHeuristics;
import android.text.TextUtils;
import android.telephony.Rlog;
@@ -1260,7 +1262,8 @@ public final class GsmMmiCode extends Handler implements MmiCode {
// {2} is time in seconds
destinations[0] = serviceClassToCFString(info.serviceClass & serviceClassMask);
- destinations[1] = PhoneNumberUtils.stringFromStringAndTOA(info.number, info.toa);
+ destinations[1] = formatLtr(
+ PhoneNumberUtils.stringFromStringAndTOA(info.number, info.toa));
destinations[2] = Integer.toString(info.timeSeconds);
if (info.reason == CommandsInterface.CF_REASON_UNCONDITIONAL &&
@@ -1275,6 +1278,13 @@ public final class GsmMmiCode extends Handler implements MmiCode {
return TextUtils.replace(template, sources, destinations);
}
+ /**
+ * Used to format a string that should be displayed as LTR even in RTL locales
+ */
+ private String formatLtr(String str) {
+ BidiFormatter fmt = BidiFormatter.getInstance();
+ return str == null ? str : fmt.unicodeWrap(str, TextDirectionHeuristics.LTR, true);
+ }
private void
onQueryCfComplete(AsyncResult ar) {