Duplicate enabled languages when there is only one enabled language

Bug: 3415274

Change-Id: Ibc17733be888044cfa5d1787b8489e642d70d70f
main
satok 2011-02-04 17:05:07 +09:00
parent f5cf266ad9
commit c98a943eda
2 changed files with 10 additions and 3 deletions

View File

@ -426,8 +426,15 @@ public class SubtypeSwitcher {
if (mConfigUseSpacebarLanguageSwitcher) {
return mLanguageSwitcher.getEnabledLanguages();
} else {
int enabledLanguageCount = mEnabledLanguagesOfCurrentInputMethod.size();
// Workaround for explicitly specifying the voice language
if (enabledLanguageCount == 1) {
mEnabledLanguagesOfCurrentInputMethod.add(
mEnabledLanguagesOfCurrentInputMethod.get(0));
++enabledLanguageCount;
}
return mEnabledLanguagesOfCurrentInputMethod.toArray(
new String[mEnabledLanguagesOfCurrentInputMethod.size()]);
new String[enabledLanguageCount]);
}
}

View File

@ -81,7 +81,7 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
private static final int RECOGNITIONVIEW_HEIGHT_THRESHOLD_RATIO = 6;
private static final String TAG = VoiceIMEConnector.class.getSimpleName();
private static boolean DEBUG = LatinImeLogger.sDBG;
private static final boolean DEBUG = LatinImeLogger.sDBG;
private boolean mAfterVoiceInput;
private boolean mHasUsedVoiceInput;
@ -715,7 +715,7 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
mHandler.updateVoiceResults();
}
public FieldContext makeFieldContext() {
private FieldContext makeFieldContext() {
SubtypeSwitcher switcher = SubtypeSwitcher.getInstance();
return new FieldContext(mService.getCurrentInputConnection(),
mService.getCurrentInputEditorInfo(), switcher.getInputLocaleStr(),