Remove redundant check to detect forceAscii
Change-Id: Ib3272ec19a90b3aa4937573e049ceb86855ea408
This commit is contained in:
parent
f173b12b03
commit
61dbda00de
2 changed files with 7 additions and 10 deletions
|
@ -205,7 +205,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
final boolean subtypeChanged = (oldKeyboard == null)
|
final boolean subtypeChanged = (oldKeyboard == null)
|
||||||
|| !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
|
|| !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
|
||||||
final boolean needsToDisplayLanguage = mSubtypeSwitcher.needsToDisplayLanguage(
|
final boolean needsToDisplayLanguage = mSubtypeSwitcher.needsToDisplayLanguage(
|
||||||
keyboard.mId.mLocale);
|
keyboard.mId.mSubtype);
|
||||||
keyboardView.startDisplayLanguageOnSpacebar(subtypeChanged, needsToDisplayLanguage,
|
keyboardView.startDisplayLanguageOnSpacebar(subtypeChanged, needsToDisplayLanguage,
|
||||||
RichInputMethodManager.getInstance().hasMultipleEnabledIMEsOrSubtypes(true));
|
RichInputMethodManager.getInstance().hasMultipleEnabledIMEsOrSubtypes(true));
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,10 @@ public final class SubtypeSwitcher {
|
||||||
private int mEnabledSubtypeCount;
|
private int mEnabledSubtypeCount;
|
||||||
private boolean mIsSystemLanguageSameAsInputLanguage;
|
private boolean mIsSystemLanguageSameAsInputLanguage;
|
||||||
|
|
||||||
public boolean getValue() {
|
public boolean needsToDisplayLanguage(final InputMethodSubtype subtype) {
|
||||||
|
if (SubtypeLocaleUtils.isNoLanguage(subtype)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return mEnabledSubtypeCount >= 2 || !mIsSystemLanguageSameAsInputLanguage;
|
return mEnabledSubtypeCount >= 2 || !mIsSystemLanguageSameAsInputLanguage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,14 +268,8 @@ public final class SubtypeSwitcher {
|
||||||
// Subtype Switching functions //
|
// Subtype Switching functions //
|
||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
|
|
||||||
public boolean needsToDisplayLanguage(final Locale keyboardLocale) {
|
public boolean needsToDisplayLanguage(final InputMethodSubtype subtype) {
|
||||||
if (keyboardLocale.toString().equals(SubtypeLocaleUtils.NO_LANGUAGE)) {
|
return mNeedsToDisplayLanguage.needsToDisplayLanguage(subtype);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!keyboardLocale.equals(getCurrentSubtypeLocale())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return mNeedsToDisplayLanguage.getValue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSystemLocaleSameAsLocaleOfAllEnabledSubtypesOfEnabledImes() {
|
public boolean isSystemLocaleSameAsLocaleOfAllEnabledSubtypesOfEnabledImes() {
|
||||||
|
|
Loading…
Reference in a new issue