diff options
author | 2012-10-02 17:09:56 +0900 | |
---|---|---|
committer | 2012-10-02 17:29:15 +0900 | |
commit | aec5cc84760b47661ccc5a0c938368d3798be6b4 (patch) | |
tree | ecd58577645f2812f94f30119ffd20f8b2640295 /java/src | |
parent | 6fd7fe50330852bafc01d7b3838d834a325c6ede (diff) | |
download | latinime-aec5cc84760b47661ccc5a0c938368d3798be6b4.tar.gz latinime-aec5cc84760b47661ccc5a0c938368d3798be6b4.tar.xz latinime-aec5cc84760b47661ccc5a0c938368d3798be6b4.zip |
Avoid calling switchToLastInputMethod when other IMEs are in effect
Bug: 7268389
Change-Id: I4d960cbf063002b4dc0ea813c966366b56c0346d
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 311355374..494846b04 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1219,22 +1219,25 @@ public final class LatinIME extends InputMethodService implements KeyboardAction mConnection.performEditorAction(actionId); } + // TODO: Revise the language switch key behavior to make it much smarter and more reasonable. private void handleLanguageSwitchKey() { - final boolean includesOtherImes = mCurrentSettings.mIncludesOtherImesInLanguageSwitchList; final IBinder token = getWindow().getWindow().getAttributes().token; + if (mCurrentSettings.mIncludesOtherImesInLanguageSwitchList) { + mImm.switchToNextInputMethod(token, false /* onlyCurrentIme */); + return; + } if (mShouldSwitchToLastSubtype) { final InputMethodSubtype lastSubtype = mImm.getLastInputMethodSubtype(); final boolean lastSubtypeBelongsToThisIme = ImfUtils.checkIfSubtypeBelongsToThisImeAndEnabled(this, lastSubtype); - if ((includesOtherImes || lastSubtypeBelongsToThisIme) - && mImm.switchToLastInputMethod(token)) { + if (lastSubtypeBelongsToThisIme && mImm.switchToLastInputMethod(token)) { mShouldSwitchToLastSubtype = false; } else { - mImm.switchToNextInputMethod(token, !includesOtherImes); + mImm.switchToNextInputMethod(token, true /* onlyCurrentIme */); mShouldSwitchToLastSubtype = true; } } else { - mImm.switchToNextInputMethod(token, !includesOtherImes); + mImm.switchToNextInputMethod(token, true /* onlyCurrentIme */); } } |