summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/inputmethod
diff options
context:
space:
mode:
authorsatok <satok@google.com>2010-11-04 21:17:48 +0900
committersatok <satok@google.com>2010-11-05 11:40:56 +0900
commit9ef0283bdcd9534cc09ae37eb2b78771b95247b5 (patch)
tree2819ed8e9c104af435d741a1778cf1e5f584e078 /core/java/android/view/inputmethod
parent63cf0279d73937f38def42eeb0ef8278c926e448 (diff)
downloadframeworks_base-9ef0283bdcd9534cc09ae37eb2b78771b95247b5.zip
frameworks_base-9ef0283bdcd9534cc09ae37eb2b78771b95247b5.tar.gz
frameworks_base-9ef0283bdcd9534cc09ae37eb2b78771b95247b5.tar.bz2
Change API for getting InputMethodSubtype's mode from resource id to String
Change-Id: I00aa99f8ab9901d40806a6bb336ab718eb857e8b
Diffstat (limited to 'core/java/android/view/inputmethod')
-rw-r--r--core/java/android/view/inputmethod/InputMethodInfo.java4
-rw-r--r--core/java/android/view/inputmethod/InputMethodSubtype.java24
2 files changed, 14 insertions, 14 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodInfo.java b/core/java/android/view/inputmethod/InputMethodInfo.java
index 54102f6..defd104 100644
--- a/core/java/android/view/inputmethod/InputMethodInfo.java
+++ b/core/java/android/view/inputmethod/InputMethodInfo.java
@@ -142,8 +142,8 @@ public final class InputMethodInfo implements Parcelable {
.InputMethod_Subtype_icon, 0),
a.getString(com.android.internal.R.styleable
.InputMethod_Subtype_imeSubtypeLocale),
- a.getResourceId(com.android.internal.R.styleable
- .InputMethod_Subtype_imeSubtypeMode, 0),
+ a.getString(com.android.internal.R.styleable
+ .InputMethod_Subtype_imeSubtypeMode),
a.getString(com.android.internal.R.styleable
.InputMethod_Subtype_imeSubtypeExtraValue));
mSubtypes.add(subtype);
diff --git a/core/java/android/view/inputmethod/InputMethodSubtype.java b/core/java/android/view/inputmethod/InputMethodSubtype.java
index a1ed044..0925940 100644
--- a/core/java/android/view/inputmethod/InputMethodSubtype.java
+++ b/core/java/android/view/inputmethod/InputMethodSubtype.java
@@ -34,7 +34,7 @@ public final class InputMethodSubtype implements Parcelable {
private final int mSubtypeNameResId;
private final int mSubtypeIconResId;
private final String mSubtypeLocale;
- private final int mSubtypeModeResId;
+ private final String mSubtypeMode;
private final String mSubtypeExtraValue;
private final int mSubtypeHashCode;
@@ -46,24 +46,24 @@ public final class InputMethodSubtype implements Parcelable {
* @param modeId The mode supported by the subtype
* @param extraValue The extra value of the subtype
*/
- InputMethodSubtype(int nameId, int iconId, String locale, int modeId, String extraValue) {
+ InputMethodSubtype(int nameId, int iconId, String locale, String mode, String extraValue) {
mSubtypeNameResId = nameId;
mSubtypeIconResId = iconId;
mSubtypeLocale = locale;
- mSubtypeModeResId = modeId;
+ mSubtypeMode = mode;
mSubtypeExtraValue = extraValue;
mSubtypeHashCode = hashCodeInternal(mSubtypeNameResId, mSubtypeIconResId, mSubtypeLocale,
- mSubtypeModeResId, mSubtypeExtraValue);
+ mSubtypeMode, mSubtypeExtraValue);
}
InputMethodSubtype(Parcel source) {
mSubtypeNameResId = source.readInt();
mSubtypeIconResId = source.readInt();
mSubtypeLocale = source.readString();
- mSubtypeModeResId = source.readInt();
+ mSubtypeMode = source.readString();
mSubtypeExtraValue = source.readString();
mSubtypeHashCode = hashCodeInternal(mSubtypeNameResId, mSubtypeIconResId, mSubtypeLocale,
- mSubtypeModeResId, mSubtypeExtraValue);
+ mSubtypeMode, mSubtypeExtraValue);
}
/**
@@ -90,8 +90,8 @@ public final class InputMethodSubtype implements Parcelable {
/**
* @return the mode of the subtype
*/
- public int getModeResId() {
- return mSubtypeModeResId;
+ public String getMode() {
+ return mSubtypeMode;
}
/**
@@ -111,7 +111,7 @@ public final class InputMethodSubtype implements Parcelable {
if (o instanceof InputMethodSubtype) {
InputMethodSubtype subtype = (InputMethodSubtype) o;
return (subtype.getNameResId() == getNameResId())
- && (subtype.getModeResId() == getModeResId())
+ && (subtype.getMode() == getMode())
&& (subtype.getIconResId() == getIconResId())
&& (subtype.getLocale().equals(getLocale()))
&& (subtype.getExtraValue().equals(getExtraValue()));
@@ -127,7 +127,7 @@ public final class InputMethodSubtype implements Parcelable {
dest.writeInt(mSubtypeNameResId);
dest.writeInt(mSubtypeIconResId);
dest.writeString(mSubtypeLocale);
- dest.writeInt(mSubtypeModeResId);
+ dest.writeString(mSubtypeMode);
dest.writeString(mSubtypeExtraValue);
}
@@ -143,7 +143,7 @@ public final class InputMethodSubtype implements Parcelable {
};
private static int hashCodeInternal(int nameResId, int iconResId, String locale,
- int modeResId, String extraValue) {
- return Arrays.hashCode(new Object[] {nameResId, iconResId, locale, modeResId, extraValue});
+ String mode, String extraValue) {
+ return Arrays.hashCode(new Object[] {nameResId, iconResId, locale, mode, extraValue});
}
} \ No newline at end of file