Lines Matching defs:subtype

297      * The current subtype of the current input method.
1284 final InputMethodSubtype subtype = subtypes.get(j);
1285 if (!subtype.isAuxiliary()) {
1287 nonAuxSubtype = subtype;
1290 auxSubtype = subtype;
1435 // See if we need to notify a subtype change within the same IME.
1446 // If subtype is null, try to find the most applicable one from
1451 Slog.w(TAG, "Illegal subtype state: old subtype = " + oldSubtype
1452 + ", new subtype = " + newSubtype);
1472 // Set a subtype to this input method.
1473 // subtypeId the name of a subtype which will be set.
1779 // Always call subtype picker, because subtype picker is a superset of input method
1791 public void setInputMethodAndSubtype(IBinder token, String id, InputMethodSubtype subtype) {
1793 if (subtype != null) {
1795 mMethodMap.get(id), subtype.hashCode()));
1832 // If the last IME is the same as the current IME and the last subtype is not
1843 // the most applicable enabled keyboard subtype of the system imes.
2173 final InputMethodSubtype subtype = imi.getSubtypeAt(i);
2174 if (subtype.overridesImplicitlyEnabledSubtype() && subtype.getMode().equals(mode)) {
2175 subtypes.add(subtype);
2635 private boolean canAddToLastInputMethod(InputMethodSubtype subtype) {
2636 if (subtype == null) return true;
2637 return !subtype.isAuxiliary();
2661 InputMethodSubtype subtype = imi.getSubtypeAt(subtypeId);
2662 mSettings.putSelectedSubtype(subtype.hashCode());
2663 mCurrentSubtype = subtype;
2666 // If the subtype is not specified, choose the most applicable one
2697 Slog.w(TAG, "HashCode for subtype looks broken: " + subtypeHashCode, e);
2746 InputMethodSubtype subtype = subtypes.get(i);
2747 if (subtype.overridesImplicitlyEnabledSubtype()) {
2748 final String mode = subtype.getMode();
2750 applicableModeAndSubtypesMap.put(mode, subtype);
2758 final InputMethodSubtype subtype = subtypes.get(i);
2759 final String locale = subtype.getLocale();
2760 final String mode = subtype.getMode();
2761 // When system locale starts with subtype's locale, that subtype will be applicable
2764 // subtype = en, but it is not necessarily considered applicable for cases like system
2765 // locale = en and subtype = en_US.
2776 applicableModeAndSubtypesMap.put(mode, subtype);
2785 final InputMethodSubtype subtype = subtypes.get(i);
2786 final String mode = subtype.getMode();
2787 if (SUBTYPE_MODE_KEYBOARD.equals(mode) && subtype.containsExtraValueKey(
2789 applicableSubtypes.add(subtype);
2806 * @param subtypes this function will search the most applicable subtype in subtypes
2809 * @param canIgnoreLocaleAsLastResort if this function can't find the most applicable subtype,
2810 * it will return the first subtype matched with mode
2828 InputMethodSubtype subtype = subtypes.get(i);
2829 final String subtypeLocale = subtype.getLocale();
2830 // An applicable subtype should match "mode". If mode is null, mode will be ignored,
2834 firstMatchedModeSubtype = subtype;
2837 // Exact match (e.g. system locale is "en_US" and subtype locale is "en_US")
2838 applicableSubtype = subtype;
2841 // Partial match (e.g. system locale is "en_US" and subtype locale is "en")
2842 applicableSubtype = subtype;
2852 // The first subtype applicable to the system locale will be defined as the most applicable
2853 // subtype.
2871 // Search applicable subtype for each InputMethodInfo
2877 InputMethodSubtype subtype = null;
2880 // 1. Search by the current subtype's locale from enabledSubtypes.
2882 subtype = findLastResortApplicableSubtypeLocked(
2886 // 3. Search the first enabled subtype matched with mode from enabledSubtypes.
2887 if (subtype == null) {
2888 subtype = findLastResortApplicableSubtypeLocked(
2896 // 4. Search by the current subtype's locale from all subtypes.
2897 if (subtype == null && mCurrentSubtype != null) {
2898 subtype = findLastResortApplicableSubtypeLocked(
2902 // 6. Search the first enabled subtype matched with mode from all subtypes.
2903 if (subtype == null) {
2904 subtype = findLastResortApplicableSubtypeLocked(
2907 if (subtype != null) {
2911 mostApplicableSubtype = subtype;
2916 mostApplicableSubtype = subtype;
2929 Slog.w(TAG, "Most applicable shortcut input method subtype was:"
2944 * @return Return the current subtype of this input method.
2967 // the most applicable subtype from explicitly or implicitly enabled
2971 // If there is only one explicitly or implicitly enabled subtype,
2994 InputMethodSubtype subtype) {
2996 mShortcutInputMethodsAndSubtypes.get(imi).add(subtype);
2999 subtypes.add(subtype);
3012 // the most applicable subtype from all subtypes whose mode is
3025 for (InputMethodSubtype subtype: mShortcutInputMethodsAndSubtypes.get(imi)) {
3026 ret.add(subtype);
3034 public boolean setCurrentInputMethodSubtype(InputMethodSubtype subtype) {
3036 if (subtype != null && mCurMethodId != null) {
3038 int subtypeId = getSubtypeIdFromHashCode(imi, subtype.hashCode());
3078 boolean onlyCurrentIme, InputMethodInfo imi, InputMethodSubtype subtype) {
3087 final int currentSubtypeId = subtype != null
3088 ? getSubtypeIdFromHashCode(imi, subtype.hashCode())
3126 for (InputMethodSubtype subtype: explicitlyOrImplicitlyEnabledSubtypeList) {
3127 enabledSubtypeSet.add(String.valueOf(subtype.hashCode()));
3137 final InputMethodSubtype subtype = imi.getSubtypeAt(j);
3138 final String subtypeHashCode = String.valueOf(subtype.hashCode());
3141 && ((inputShown && !isScreenLocked) || !subtype.isAuxiliary())) {
3143 subtype.overridesImplicitlyEnabledSubtype() ? null
3144 : subtype.getDisplayName(mContext, imi.getPackageName(),
3147 subtype.getLocale(), mSystemLocaleStr));
3149 // Removing this subtype from enabledSubtypeSet because we no longer
3150 // need to add an entry of this subtype to imList to avoid duplicated
3410 Slog.v(TAG, "Add subtype to the history: " + imeId + ", " + subtypeId);
3443 // If imeId is empty, returns the first IME and subtype in the history
3451 Slog.d(TAG, "Enabled subtype found in the history: " + subtypeHashCode);
3493 // Check whether the subtype id is valid or not
3561 private static final String NODE_SUBTYPE = "subtype";
3609 final InputMethodSubtype subtype = additionalSubtypes[i];
3610 if (!subtypes.contains(subtype)) {
3611 subtypes.add(subtype);
3649 final InputMethodSubtype subtype = subtypesList.get(i);
3651 out.attribute(null, ATTR_ICON, String.valueOf(subtype.getIconResId()));
3652 out.attribute(null, ATTR_LABEL, String.valueOf(subtype.getNameResId()));
3653 out.attribute(null, ATTR_IME_SUBTYPE_LOCALE, subtype.getLocale());
3654 out.attribute(null, ATTR_IME_SUBTYPE_MODE, subtype.getMode());
3655 out.attribute(null, ATTR_IME_SUBTYPE_EXTRA_VALUE, subtype.getExtraValue());
3657 String.valueOf(subtype.isAuxiliary() ? 1 : 0));
3723 final InputMethodSubtype subtype =
3726 tempSubtypesArray.add(subtype);