summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author satok <satok@google.com> 2011-04-27 16:09:53 +0900
committer satok <satok@google.com> 2011-04-27 16:09:53 +0900
commitece92d34fcf273f68f33d2fd8e5764764fc0c66d (patch)
tree99434b823cb3bf2523b85cd65839697a8547f8c0
parentf076aa5594840baf70fd78a00d1152bd13dfb80c (diff)
Fix a bug in InputMethodSubtype#hashCode
Bug: 4345760 Not to use resource ids for calculating hashCode Change-Id: I29d2555aeb7d0e51205d9f1fe0da708df0890942
-rw-r--r--core/java/android/view/inputmethod/InputMethodSubtype.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodSubtype.java b/core/java/android/view/inputmethod/InputMethodSubtype.java
index 25f2229936aa..807f6ce9aefe 100644
--- a/core/java/android/view/inputmethod/InputMethodSubtype.java
+++ b/core/java/android/view/inputmethod/InputMethodSubtype.java
@@ -60,8 +60,7 @@ public final class InputMethodSubtype implements Parcelable {
mSubtypeLocale = locale != null ? locale : "";
mSubtypeMode = mode != null ? mode : "";
mSubtypeExtraValue = extraValue != null ? extraValue : "";
- mSubtypeHashCode = hashCodeInternal(mSubtypeNameResId, mSubtypeIconResId, mSubtypeLocale,
- mSubtypeMode, mSubtypeExtraValue);
+ mSubtypeHashCode = hashCodeInternal(mSubtypeLocale, mSubtypeMode, mSubtypeExtraValue);
}
InputMethodSubtype(Parcel source) {
@@ -74,8 +73,7 @@ public final class InputMethodSubtype implements Parcelable {
mSubtypeMode = s != null ? s : "";
s = source.readString();
mSubtypeExtraValue = s != null ? s : "";
- mSubtypeHashCode = hashCodeInternal(mSubtypeNameResId, mSubtypeIconResId, mSubtypeLocale,
- mSubtypeMode, mSubtypeExtraValue);
+ mSubtypeHashCode = hashCodeInternal(mSubtypeLocale, mSubtypeMode, mSubtypeExtraValue);
}
/**
@@ -195,9 +193,8 @@ public final class InputMethodSubtype implements Parcelable {
}
};
- private static int hashCodeInternal(int nameResId, int iconResId, String locale,
- String mode, String extraValue) {
- return Arrays.hashCode(new Object[] {nameResId, iconResId, locale, mode, extraValue});
+ private static int hashCodeInternal(String locale, String mode, String extraValue) {
+ return Arrays.hashCode(new Object[] {locale, mode, extraValue});
}
/**