summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2015-02-20 20:55:21 +0900
committerYohei Yukawa <yukawa@google.com>2015-02-20 23:41:36 +0900
commite72d1c82743c4d573e529d4da3866c1fcea35c77 (patch)
tree0313baaf23843d987024528a8afe38d8bb8d4fc6 /core/java
parent8f3b76cb0c7187464d58c84fd77e20a9cb4fd3d1 (diff)
downloadframeworks_base-e72d1c82743c4d573e529d4da3866c1fcea35c77.zip
frameworks_base-e72d1c82743c4d573e529d4da3866c1fcea35c77.tar.gz
frameworks_base-e72d1c82743c4d573e529d4da3866c1fcea35c77.tar.bz2
Add tests for Ibb9eb9f65323795d139 and I6571d464a46453934f0
This CL adds several unit tests for following CLs, both of which enabled InputMethodUtils (and dependent IMF logic) to handle 3 letter language codes and conversion from deprecated two-letter codes to new ones correctly. - Ibb9eb9f65323795d139b16d76b7e7e36a4e0568c - I6571d464a46453934f0a8f5e79018a67a9a3c845 As described in tests, the input method framework has already been able to recognize 3 letter language codes. However, there remain inconsistencies when we use deprecated 2-letter code to query subtype like "in" but the subtype has new language codes like "id". Subsequent CLs are supposed to address remaining issues. bug: 10090157 Change-Id: I7d932e60311b80c05be8f02c9e803f18da0e0054
Diffstat (limited to 'core/java')
-rw-r--r--core/java/com/android/internal/inputmethod/InputMethodUtils.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/com/android/internal/inputmethod/InputMethodUtils.java b/core/java/com/android/internal/inputmethod/InputMethodUtils.java
index 183527c..9ae9fa7 100644
--- a/core/java/com/android/internal/inputmethod/InputMethodUtils.java
+++ b/core/java/com/android/internal/inputmethod/InputMethodUtils.java
@@ -35,6 +35,8 @@ import android.view.inputmethod.InputMethodSubtype;
import android.view.textservice.SpellCheckerInfo;
import android.view.textservice.TextServicesManager;
+import com.android.internal.annotations.VisibleForTesting;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -518,7 +520,8 @@ public class InputMethodUtils {
return NOT_A_SUBTYPE_ID;
}
- private static ArrayList<InputMethodSubtype> getImplicitlyApplicableSubtypesLocked(
+ @VisibleForTesting
+ public static ArrayList<InputMethodSubtype> getImplicitlyApplicableSubtypesLocked(
Resources res, InputMethodInfo imi) {
final List<InputMethodSubtype> subtypes = InputMethodUtils.getSubtypes(imi);
final String systemLocale = res.getConfiguration().locale.toString();