aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2012-01-13 11:13:35 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-01-13 11:13:35 -0800
commitfadaef0d9722adcc426084cb4dd19ae21fb468b8 (patch)
tree7c607ce5c478d4cfed5affcc1b7c7691b615da2e /java
parent242a48e7a510f759d67a220ebfea40a2cd4cdba4 (diff)
parent4da8e8e4d3bc430f1b0519840f63addbce949d84 (diff)
downloadlatinime-fadaef0d9722adcc426084cb4dd19ae21fb468b8.tar.gz
latinime-fadaef0d9722adcc426084cb4dd19ae21fb468b8.tar.xz
latinime-fadaef0d9722adcc426084cb4dd19ae21fb468b8.zip
am 4da8e8e4: Merge "Fix a bug in the logic to show 3 dots of the ime switcher"
* commit '4da8e8e4d3bc430f1b0519840f63addbce949d84': Fix a bug in the logic to show 3 dots of the ime switcher
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/latin/SubtypeSwitcher.java2
-rw-r--r--java/src/com/android/inputmethod/latin/Utils.java19
2 files changed, 16 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
index 42111822d..f5778167a 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
@@ -46,8 +46,8 @@ public class SubtypeSwitcher {
private static boolean DBG = LatinImeLogger.sDBG;
private static final String TAG = SubtypeSwitcher.class.getSimpleName();
+ public static final String KEYBOARD_MODE = "keyboard";
private static final char LOCALE_SEPARATER = '_';
- private static final String KEYBOARD_MODE = "keyboard";
private static final String VOICE_MODE = "voice";
private static final String SUBTYPE_EXTRAVALUE_REQUIRE_NETWORK_CONNECTIVITY =
"requireNetworkConnectivity";
diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java
index 38148438b..8e0cfa122 100644
--- a/java/src/com/android/inputmethod/latin/Utils.java
+++ b/java/src/com/android/inputmethod/latin/Utils.java
@@ -154,10 +154,21 @@ public class Utils {
}
}
- return filteredImisCount > 1
- // imm.getEnabledInputMethodSubtypeList(null, false) will return the current IME's enabled
- // input method subtype (The current IME should be LatinIME.)
- || imm.getEnabledInputMethodSubtypeList(null, false).size() > 1;
+ if (filteredImisCount > 1) {
+ return true;
+ }
+ final List<InputMethodSubtypeCompatWrapper> subtypes =
+ imm.getEnabledInputMethodSubtypeList(null, true);
+ int keyboardCount = 0;
+ // imm.getEnabledInputMethodSubtypeList(null, true) will return the current IME's
+ // both explicitly and implicitly enabled input method subtype.
+ // (The current IME should be LatinIME.)
+ for (InputMethodSubtypeCompatWrapper subtype : subtypes) {
+ if (SubtypeSwitcher.KEYBOARD_MODE.equals(subtype.getMode())) {
+ ++keyboardCount;
+ }
+ }
+ return keyboardCount > 1;
}
public static String getInputMethodId(InputMethodManagerCompatWrapper imm, String packageName) {