am 5fd5aa3d: Fix compatibility issue on InputMethodSubtype

* commit '5fd5aa3d066fc12c92b5b6541d85ac243556223f':
  Fix compatibility issue on InputMethodSubtype
This commit is contained in:
Satoshi Kataoka
2013-11-13 22:25:01 -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});
}