aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-10-02 01:36:37 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-02 01:36:37 -0700
commitc3aea8ea9f695712dd67edde21176753f890f33c (patch)
tree29c9b2cfd93c646eabda7e2155d5eeaa7bf44b96 /java/src
parentfe3fb2502dad6a5935f5226f2310d33dc0fde6a1 (diff)
parentaec5cc84760b47661ccc5a0c938368d3798be6b4 (diff)
downloadlatinime-c3aea8ea9f695712dd67edde21176753f890f33c.tar.gz
latinime-c3aea8ea9f695712dd67edde21176753f890f33c.tar.xz
latinime-c3aea8ea9f695712dd67edde21176753f890f33c.zip
Merge "Avoid calling switchToLastInputMethod when other IMEs are in effect"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java13
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 */);
}
}