summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Satoshi Kataoka <satok@google.com> 2013-11-14 12:04:51 +0900
committer Satoshi Kataoka <satok@google.com> 2013-11-14 15:08:39 +0900
commit5fd5aa3d066fc12c92b5b6541d85ac243556223f (patch)
tree301c683081b4c800dff1d4cef240aad5df666c45
parent48d2bcf2ce2305356c5a4f0dfbb928dc5a4c8331 (diff)
Fix compatibility issue on InputMethodSubtype
Bug: 11032428 Change-Id: If722bbbfb69d00e1830007582d46a33319203eea
-rw-r--r--core/java/android/view/inputmethod/InputMethodSubtype.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodSubtype.java b/core/java/android/view/inputmethod/InputMethodSubtype.java
index 40f95cea1d18..2ab30246662c 100644
--- a/core/java/android/view/inputmethod/InputMethodSubtype.java
+++ b/core/java/android/view/inputmethod/InputMethodSubtype.java
@@ -534,6 +534,13 @@ public final class InputMethodSubtype implements Parcelable {
private static int hashCodeInternal(String locale, String mode, String extraValue,
boolean isAuxiliary, boolean overridesImplicitlyEnabledSubtype,
boolean isAsciiCapable) {
+ // CAVEAT: Must revisit how to compute needsToCalculateCompatibleHashCode when a new
+ // attribute is added in order to avoid enabled subtypes being unexpectedly disabled.
+ final boolean needsToCalculateCompatibleHashCode = !isAsciiCapable;
+ if (needsToCalculateCompatibleHashCode) {
+ return Arrays.hashCode(new Object[] {locale, mode, extraValue, isAuxiliary,
+ overridesImplicitlyEnabledSubtype});
+ }
return Arrays.hashCode(new Object[] {locale, mode, extraValue, isAuxiliary,
overridesImplicitlyEnabledSubtype, isAsciiCapable});
}