Fix compatibility issue on InputMethodSubtype

Bug: 11032428
Change-Id: If722bbbfb69d00e1830007582d46a33319203eea
This commit is contained in:
Satoshi Kataoka
2013-11-14 12:04:51 +09:00
parent 48d2bcf2ce
commit 5fd5aa3d06

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