From c50232d517d7b99ae3c3e073f04eb6799c876e8c Mon Sep 17 00:00:00 2001 From: satok Date: Fri, 25 Mar 2011 13:52:48 +0900 Subject: [PATCH] Add hashCode to InputMethodInfo The uniqueness of InputMethodInfo was guaranteed by mId (like InputMethodInfo#equals), but the hashCode was not implemented in the same way. This change fixes a problem happening when the user gets the hashCode of InputMethodInfo obtained through IPC. Change-Id: Ib876c5cb0d778481100597ec31202f94fb7b8f37 --- api/current.xml | 2 +- core/java/android/view/inputmethod/InputMethodInfo.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/current.xml b/api/current.xml index df2c756685530..059322d16f1f9 100644 --- a/api/current.xml +++ b/api/current.xml @@ -267763,7 +267763,7 @@ deprecated="not deprecated" visibility="public" > - + diff --git a/core/java/android/view/inputmethod/InputMethodInfo.java b/core/java/android/view/inputmethod/InputMethodInfo.java index 32eec9fa0e559..1f7441de49cfc 100644 --- a/core/java/android/view/inputmethod/InputMethodInfo.java +++ b/core/java/android/view/inputmethod/InputMethodInfo.java @@ -322,7 +322,12 @@ public final class InputMethodInfo implements Parcelable { InputMethodInfo obj = (InputMethodInfo) o; return mId.equals(obj.mId); } - + + @Override + public int hashCode() { + return mId.hashCode(); + } + /** * Used to package this object into a {@link Parcel}. *