Loading api/current.xml +3 −3 Original line number Diff line number Diff line Loading @@ -219190,8 +219190,8 @@ visibility="public" > </method> <method name="getModeResId" return="int" <method name="getMode" return="java.lang.String" abstract="false" native="false" synchronized="false" Loading Loading @@ -245869,7 +245869,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="t" type="T"> <parameter name="arg0" type="T"> </parameter> </method> </interface> core/java/android/inputmethodservice/InputMethodService.java +2 −2 Original line number Diff line number Diff line Loading @@ -2086,10 +2086,10 @@ public class InputMethodService extends AbstractInputMethodService { protected void onCurrentInputMethodSubtypeChanged(InputMethodSubtype newSubtype) { if (DEBUG) { int nameResId = newSubtype.getNameResId(); int modeResId = newSubtype.getModeResId(); String mode = newSubtype.getMode(); String output = "changeInputMethodSubtype:" + (nameResId == 0 ? "<none>" : getString(nameResId)) + "," + (modeResId == 0 ? "<none>" : getString(modeResId)) + "," + mode + "," + newSubtype.getLocale() + "," + newSubtype.getExtraValue(); Log.v(TAG, "--- " + output); } Loading core/java/android/view/inputmethod/InputMethodInfo.java +2 −2 Original line number Diff line number Diff line Loading @@ -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); Loading core/java/android/view/inputmethod/InputMethodSubtype.java +12 −12 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); } /** Loading @@ -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; } /** Loading @@ -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())); Loading @@ -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); } Loading @@ -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 services/java/com/android/server/InputMethodManagerService.java +12 −12 Original line number Diff line number Diff line Loading @@ -1622,15 +1622,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub if (enabledSubtypeSet.contains(String.valueOf(subtype.hashCode()))) { CharSequence title; int nameResId = subtype.getNameResId(); int modeResId = subtype.getModeResId(); String mode = subtype.getMode(); if (nameResId != 0) { title = pm.getText(property.getPackageName(), nameResId, property.getServiceInfo().applicationInfo); } else { CharSequence language = subtype.getLocale(); CharSequence mode = modeResId == 0 ? null : pm.getText(property.getPackageName(), modeResId, property.getServiceInfo().applicationInfo); // TODO: Use more friendly Title and UI title = label + "," + (mode == null ? "" : mode) + "," + (language == null ? "" : language); Loading Loading @@ -1869,6 +1866,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub int applicableSubtypeId = DEFAULT_SUBTYPE_ID; for (int i = 0; i < subtypes.size(); ++i) { final String subtypeLocale = subtypes.get(i).getLocale(); // An applicable subtype should be a keyboard subtype if (subtypes.get(i).getMode().equalsIgnoreCase("keyboard")) { if (locale.equals(subtypeLocale)) { // Exact match (e.g. system locale is "en_US" and subtype locale is "en_US") applicableSubtypeId = i; Loading @@ -1879,6 +1878,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub partialMatchFound = true; } } } // The first subtype applicable to the system locale will be defined as the most applicable // subtype. Loading Loading
api/current.xml +3 −3 Original line number Diff line number Diff line Loading @@ -219190,8 +219190,8 @@ visibility="public" > </method> <method name="getModeResId" return="int" <method name="getMode" return="java.lang.String" abstract="false" native="false" synchronized="false" Loading Loading @@ -245869,7 +245869,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="t" type="T"> <parameter name="arg0" type="T"> </parameter> </method> </interface>
core/java/android/inputmethodservice/InputMethodService.java +2 −2 Original line number Diff line number Diff line Loading @@ -2086,10 +2086,10 @@ public class InputMethodService extends AbstractInputMethodService { protected void onCurrentInputMethodSubtypeChanged(InputMethodSubtype newSubtype) { if (DEBUG) { int nameResId = newSubtype.getNameResId(); int modeResId = newSubtype.getModeResId(); String mode = newSubtype.getMode(); String output = "changeInputMethodSubtype:" + (nameResId == 0 ? "<none>" : getString(nameResId)) + "," + (modeResId == 0 ? "<none>" : getString(modeResId)) + "," + mode + "," + newSubtype.getLocale() + "," + newSubtype.getExtraValue(); Log.v(TAG, "--- " + output); } Loading
core/java/android/view/inputmethod/InputMethodInfo.java +2 −2 Original line number Diff line number Diff line Loading @@ -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); Loading
core/java/android/view/inputmethod/InputMethodSubtype.java +12 −12 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); } /** Loading @@ -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; } /** Loading @@ -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())); Loading @@ -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); } Loading @@ -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
services/java/com/android/server/InputMethodManagerService.java +12 −12 Original line number Diff line number Diff line Loading @@ -1622,15 +1622,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub if (enabledSubtypeSet.contains(String.valueOf(subtype.hashCode()))) { CharSequence title; int nameResId = subtype.getNameResId(); int modeResId = subtype.getModeResId(); String mode = subtype.getMode(); if (nameResId != 0) { title = pm.getText(property.getPackageName(), nameResId, property.getServiceInfo().applicationInfo); } else { CharSequence language = subtype.getLocale(); CharSequence mode = modeResId == 0 ? null : pm.getText(property.getPackageName(), modeResId, property.getServiceInfo().applicationInfo); // TODO: Use more friendly Title and UI title = label + "," + (mode == null ? "" : mode) + "," + (language == null ? "" : language); Loading Loading @@ -1869,6 +1866,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub int applicableSubtypeId = DEFAULT_SUBTYPE_ID; for (int i = 0; i < subtypes.size(); ++i) { final String subtypeLocale = subtypes.get(i).getLocale(); // An applicable subtype should be a keyboard subtype if (subtypes.get(i).getMode().equalsIgnoreCase("keyboard")) { if (locale.equals(subtypeLocale)) { // Exact match (e.g. system locale is "en_US" and subtype locale is "en_US") applicableSubtypeId = i; Loading @@ -1879,6 +1878,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub partialMatchFound = true; } } } // The first subtype applicable to the system locale will be defined as the most applicable // subtype. Loading