am 23a7998e: Not all cyrillic scripts use east_slavic layout.

* commit '23a7998edde3b25d4dc7a14b8a653ccd325d2405':
  Not all cyrillic scripts use east_slavic layout.
main
Dan Zivkovic 2015-03-27 21:08:16 +00:00 committed by Android Git Automerger
commit 655436eb2c
1 changed files with 7 additions and 3 deletions

View File

@ -125,7 +125,12 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
return mRecommendedThreshold; return mRecommendedThreshold;
} }
private static String getKeyboardLayoutNameForScript(final int script) { private static String getKeyboardLayoutNameForLocale(final Locale locale) {
// See b/19963288.
if (locale.getLanguage().equals("sr")) {
return "south_slavic";
}
final int script = ScriptUtils.getScriptFromSpellCheckerLocale(locale);
switch (script) { switch (script) {
case ScriptUtils.SCRIPT_LATIN: case ScriptUtils.SCRIPT_LATIN:
return "qwerty"; return "qwerty";
@ -247,8 +252,7 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
} }
private Keyboard createKeyboardForLocale(final Locale locale) { private Keyboard createKeyboardForLocale(final Locale locale) {
final int script = ScriptUtils.getScriptFromSpellCheckerLocale(locale); final String keyboardLayoutName = getKeyboardLayoutNameForLocale(locale);
final String keyboardLayoutName = getKeyboardLayoutNameForScript(script);
final InputMethodSubtype subtype = AdditionalSubtypeUtils.createDummyAdditionalSubtype( final InputMethodSubtype subtype = AdditionalSubtypeUtils.createDummyAdditionalSubtype(
locale.toString(), keyboardLayoutName); locale.toString(), keyboardLayoutName);
final KeyboardLayoutSet keyboardLayoutSet = createKeyboardSetForSpellChecker(subtype); final KeyboardLayoutSet keyboardLayoutSet = createKeyboardSetForSpellChecker(subtype);