diff options
Diffstat (limited to 'common/src')
-rw-r--r-- | common/src/com/android/inputmethod/latin/common/Constants.java | 2 | ||||
-rw-r--r-- | common/src/com/android/inputmethod/latin/common/LocaleUtils.java | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/common/src/com/android/inputmethod/latin/common/Constants.java b/common/src/com/android/inputmethod/latin/common/Constants.java index abc377a84..a860d3560 100644 --- a/common/src/com/android/inputmethod/latin/common/Constants.java +++ b/common/src/com/android/inputmethod/latin/common/Constants.java @@ -179,7 +179,7 @@ public final class Constants { // (MAX_PREV_WORD_COUNT_FOR_N_GRAM + 1)-gram is supported in Java side. Needs to modify // MAX_PREV_WORD_COUNT_FOR_N_GRAM in native/jni/src/defines.h for suggestions. - public static final int MAX_PREV_WORD_COUNT_FOR_N_GRAM = 2; + public static final int MAX_PREV_WORD_COUNT_FOR_N_GRAM = 3; // Key events coming any faster than this are long-presses. public static final int LONG_PRESS_MILLISECONDS = 200; diff --git a/common/src/com/android/inputmethod/latin/common/LocaleUtils.java b/common/src/com/android/inputmethod/latin/common/LocaleUtils.java index 7f2333be5..d5878c024 100644 --- a/common/src/com/android/inputmethod/latin/common/LocaleUtils.java +++ b/common/src/com/android/inputmethod/latin/common/LocaleUtils.java @@ -104,7 +104,8 @@ public final class LocaleUtils { * @param testedLocale the locale to test. * @return a constant that measures how well the tested locale matches the reference locale. */ - public static int getMatchLevel(final String referenceLocale, final String testedLocale) { + public static int getMatchLevel(@Nullable final String referenceLocale, + @Nullable final String testedLocale) { if (StringUtils.isEmpty(referenceLocale)) { return StringUtils.isEmpty(testedLocale) ? LOCALE_FULL_MATCH : LOCALE_ANY_MATCH; } @@ -167,11 +168,8 @@ public final class LocaleUtils { * @param localeString a string specification of a locale, in a format of "ll_cc_variant" where * "ll" is a language code, "cc" is a country code. */ - @Nullable - public static Locale constructLocaleFromString(@Nullable final String localeString) { - if (localeString == null) { - return null; - } + @Nonnull + public static Locale constructLocaleFromString(@Nonnull final String localeString) { synchronized (sLocaleCache) { if (sLocaleCache.containsKey(localeString)) { return sLocaleCache.get(localeString); |