am e0e7bba1
: am 24ce3645
: Merge "Fix RuntiomeException when no custom input style is defined" into jb-dev
* commit 'e0e7bba154cdc22cf603687eeb8a46e7b57e2eb6': Fix RuntiomeException when no custom input style is defined
This commit is contained in:
commit
307b882c09
1 changed files with 6 additions and 2 deletions
|
@ -22,6 +22,7 @@ import static com.android.inputmethod.latin.Constants.Subtype.ExtraValue.KEYBOAR
|
||||||
import static com.android.inputmethod.latin.Constants.Subtype.ExtraValue.UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME;
|
import static com.android.inputmethod.latin.Constants.Subtype.ExtraValue.UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME;
|
||||||
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.inputmethod.InputMethodSubtype;
|
import android.view.inputmethod.InputMethodSubtype;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -84,11 +85,14 @@ public class AdditionalSubtype {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static InputMethodSubtype[] createAdditionalSubtypesArray(String prefSubtypes) {
|
public static InputMethodSubtype[] createAdditionalSubtypesArray(String prefSubtypes) {
|
||||||
|
if (TextUtils.isEmpty(prefSubtypes)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
final String[] prefSubtypeArray = prefSubtypes.split(PREF_SUBTYPE_SEPARATOR);
|
final String[] prefSubtypeArray = prefSubtypes.split(PREF_SUBTYPE_SEPARATOR);
|
||||||
final ArrayList<InputMethodSubtype> subtypesList =
|
final ArrayList<InputMethodSubtype> subtypesList =
|
||||||
new ArrayList<InputMethodSubtype>(prefSubtypeArray.length);
|
new ArrayList<InputMethodSubtype>(prefSubtypeArray.length);
|
||||||
for (int i = 0; i < prefSubtypeArray.length; i++) {
|
for (final String prefSubtype : prefSubtypeArray) {
|
||||||
final InputMethodSubtype subtype = createAdditionalSubtype(prefSubtypeArray[i]);
|
final InputMethodSubtype subtype = createAdditionalSubtype(prefSubtype);
|
||||||
if (subtype.getNameResId() == SubtypeLocale.UNKNOWN_KEYBOARD_LAYOUT) {
|
if (subtype.getNameResId() == SubtypeLocale.UNKNOWN_KEYBOARD_LAYOUT) {
|
||||||
// Skip unknown keyboard layout subtype. This may happen when predefined keyboard
|
// Skip unknown keyboard layout subtype. This may happen when predefined keyboard
|
||||||
// layout has been removed.
|
// layout has been removed.
|
||||||
|
|
Loading…
Reference in a new issue