am 1b570b57: am 5fd5aa3d: Fix compatibility issue on InputMethodSubtype

* commit '1b570b571a63311f7f7d5b7cc5e17b3103fa8af9':
  Fix compatibility issue on InputMethodSubtype
This commit is contained in:
Satoshi Kataoka
2013-11-13 22:28:47 -08:00
committed by Android Git Automerger

View File

@@ -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});
}