diff options
author | Roozbeh Pournader <roozbeh@google.com> | 2015-05-16 18:52:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-16 18:52:30 +0000 |
commit | e1fcced61ae81a07ca8c93d8a14dd4eb5b6e36ff (patch) | |
tree | d06e07c8b13f1292f3c7439e8a654b5d82507479 | |
parent | 921ded795f80e60fa5ba8430fc167e982f0725e2 (diff) | |
parent | f156cb31c0928cc739c4dc79813d13f92389877e (diff) | |
download | frameworks_base-e1fcced61ae81a07ca8c93d8a14dd4eb5b6e36ff.zip frameworks_base-e1fcced61ae81a07ca8c93d8a14dd4eb5b6e36ff.tar.gz frameworks_base-e1fcced61ae81a07ca8c93d8a14dd4eb5b6e36ff.tar.bz2 |
Merge "Make unicodeWrap() return null if the input string is null." into mnc-dev
-rw-r--r-- | core/java/android/text/BidiFormatter.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/text/BidiFormatter.java b/core/java/android/text/BidiFormatter.java index 2a2589a..7ea9da1 100644 --- a/core/java/android/text/BidiFormatter.java +++ b/core/java/android/text/BidiFormatter.java @@ -25,7 +25,7 @@ import java.util.Locale; /** * Utility class for formatting text for display in a potentially opposite-directionality context * without garbling. The directionality of the context is set at formatter creation and the - * directionality of the text can be either estimated or passed in when known. + * directionality of the text can be either estimated or passed in when known. * * <p>To support versions lower than {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}, * you can use the support library's {@link android.support.v4.text.BidiFormatter} class. @@ -377,9 +377,11 @@ public final class BidiFormatter { * See {@link TextDirectionHeuristics} for pre-defined heuristics. * @param isolate Whether to directionally isolate the string to prevent it from garbling the * content around it - * @return Input string after applying the above processing. + * @return Input string after applying the above processing. {@code null} if {@code str} is + * {@code null}. */ public String unicodeWrap(String str, TextDirectionHeuristic heuristic, boolean isolate) { + if (str == null) return null; final boolean isRtl = heuristic.isRtl(str, 0, str.length()); StringBuilder result = new StringBuilder(); if (getStereoReset() && isolate) { |