Merge "Duplicate enabled languages when there is only one enabled language"

This commit is contained in:
satok 2011-02-04 00:30:11 -08:00 committed by Android (Google) Code Review
commit 8dac5fe98d
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(),