Skip to content
Snippets Groups Projects
Commit c412a41a authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Remove redundant check to detect forceAscii"

parents bfd58885 61dbda00
No related branches found
No related tags found
No related merge requests found
......@@ -205,7 +205,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
final boolean subtypeChanged = (oldKeyboard == null)
|| !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
final boolean needsToDisplayLanguage = mSubtypeSwitcher.needsToDisplayLanguage(
keyboard.mId.mLocale);
keyboard.mId.mSubtype);
keyboardView.startDisplayLanguageOnSpacebar(subtypeChanged, needsToDisplayLanguage,
RichInputMethodManager.getInstance().hasMultipleEnabledIMEsOrSubtypes(true));
}
......
......@@ -93,7 +93,10 @@ public final class SubtypeSwitcher {
private int mEnabledSubtypeCount;
private boolean mIsSystemLanguageSameAsInputLanguage;
public boolean getValue() {
public boolean needsToDisplayLanguage(final InputMethodSubtype subtype) {
if (SubtypeLocaleUtils.isNoLanguage(subtype)) {
return true;
}
return mEnabledSubtypeCount >= 2 || !mIsSystemLanguageSameAsInputLanguage;
}
......@@ -265,14 +268,8 @@ public final class SubtypeSwitcher {
// Subtype Switching functions //
//////////////////////////////////
public boolean needsToDisplayLanguage(final Locale keyboardLocale) {
if (keyboardLocale.toString().equals(SubtypeLocaleUtils.NO_LANGUAGE)) {
return true;
}
if (!keyboardLocale.equals(getCurrentSubtypeLocale())) {
return false;
}
return mNeedsToDisplayLanguage.getValue();
public boolean needsToDisplayLanguage(final InputMethodSubtype subtype) {
return mNeedsToDisplayLanguage.needsToDisplayLanguage(subtype);
}
public boolean isSystemLocaleSameAsLocaleOfAllEnabledSubtypesOfEnabledImes() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment