summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2015-11-19 22:41:01 -0800
committerThe Android Automerger <android-build@google.com>2015-11-20 16:28:40 -0800
commit53e111306817c2cd77a41ad4e72cf8c7abc93ffc (patch)
tree0c7915530ffee10e667cc3e36b9b398e984bcbfc
parentb0ebff395485a26265b374a7272ea24aa6b18dae (diff)
downloadbase-android-6.0.1_r4.tar.gz
IME switcher visibility should ignore aux IMEs.android-6.0.1_r5android-6.0.1_r4
With this CL, the number of enabled auxiliary IME subtypes such as voice IME is no longer taken into account for the IME switcher visibility. Bug: 25432652 Change-Id: Iadec2950568d7174797306797791d2f69c2bfdd6
-rw-r--r--services/core/java/com/android/server/InputMethodManagerService.java21
1 files changed, 1 insertions, 20 deletions
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index cd9086d0e40e..7b45c0fe4da7 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -178,7 +178,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
static final int SECURE_SUGGESTION_SPANS_MAX_SIZE = 20;
private static final int NOT_A_SUBTYPE_ID = InputMethodUtils.NOT_A_SUBTYPE_ID;
- private static final String TAG_TRY_SUPPRESSING_IME_SWITCHER = "TrySuppressingImeSwitcher";
final Context mContext;
@@ -1705,9 +1704,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
if (N > 2) return true;
if (N < 1) return false;
int nonAuxCount = 0;
- int auxCount = 0;
- InputMethodSubtype nonAuxSubtype = null;
- InputMethodSubtype auxSubtype = null;
for(int i = 0; i < N; ++i) {
final InputMethodInfo imi = imis.get(i);
final List<InputMethodSubtype> subtypes =
@@ -1720,25 +1716,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
final InputMethodSubtype subtype = subtypes.get(j);
if (!subtype.isAuxiliary()) {
++nonAuxCount;
- nonAuxSubtype = subtype;
- } else {
- ++auxCount;
- auxSubtype = subtype;
}
}
}
- }
- if (nonAuxCount > 1 || auxCount > 1) {
- return true;
- } else if (nonAuxCount == 1 && auxCount == 1) {
- if (nonAuxSubtype != null && auxSubtype != null
- && (nonAuxSubtype.getLocale().equals(auxSubtype.getLocale())
- || auxSubtype.overridesImplicitlyEnabledSubtype()
- || nonAuxSubtype.overridesImplicitlyEnabledSubtype())
- && nonAuxSubtype.containsExtraValueKey(TAG_TRY_SUPPRESSING_IME_SWITCHER)) {
- return false;
- }
- return true;
+ if (nonAuxCount > 1) return true;
}
return false;
}