diff options
-rw-r--r-- | java/res/xml/method.xml | 8 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java | 8 | ||||
-rw-r--r-- | native/jni/src/defines.h | 6 |
3 files changed, 22 insertions, 0 deletions
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index 3d360a8f0..038707134 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -36,6 +36,7 @@ en_GB: English Great Britain/qwerty eo: Esperanto/spanish es: Spanish/spanish + es_US: Spanish United States/spanish et: Estonian/nordic fa: Persian/arabic fi: Finnish/nordic @@ -184,6 +185,13 @@ /> <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_generic" + android:subtypeId="-2066550842" + android:imeSubtypeLocale="es_US" + android:imeSubtypeMode="keyboard" + android:imeSubtypeExtraValue="KeyboardLayoutSet=spanish,AsciiCapable" + /> + <subtype android:icon="@drawable/ic_subtype_keyboard" + android:label="@string/subtype_generic" android:subtypeId="-332580523" android:imeSubtypeLocale="et" android:imeSubtypeMode="keyboard" diff --git a/java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java b/java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java index d12607721..939451899 100644 --- a/java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java +++ b/java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java @@ -85,6 +85,9 @@ public final class AdditionalSubtypeSettings extends PreferenceFragment { } static final class SubtypeLocaleAdapter extends ArrayAdapter<SubtypeLocaleItem> { + private static final String TAG = SubtypeLocaleAdapter.class.getSimpleName(); + private static final boolean DEBUG_SUBTYPE_ID = false; + public SubtypeLocaleAdapter(final Context context) { super(context, android.R.layout.simple_spinner_item); setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); @@ -94,6 +97,11 @@ public final class AdditionalSubtypeSettings extends PreferenceFragment { final int count = imi.getSubtypeCount(); for (int i = 0; i < count; i++) { final InputMethodSubtype subtype = imi.getSubtypeAt(i); + if (DEBUG_SUBTYPE_ID) { + android.util.Log.d(TAG, String.format("%-6s 0x%08x %11d %s", + subtype.getLocale(), subtype.hashCode(), subtype.hashCode(), + SubtypeLocale.getSubtypeDisplayName(subtype, context.getResources()))); + } if (subtype.containsExtraValueKey(ASCII_CAPABLE)) { items.add(createItem(context, subtype.getLocale())); } diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h index ea0f0ef70..e06ee42b0 100644 --- a/native/jni/src/defines.h +++ b/native/jni/src/defines.h @@ -250,6 +250,12 @@ static inline void prof_out(void) { #ifndef S_INT_MAX #define S_INT_MAX 2147483647 // ((1 << 31) - 1) #endif +#ifndef S_INT_MIN +// The literal constant -2147483648 does not work in C prior C90, because +// the compiler tries to fit the positive number into an int and then negate it. +// GCC warns about this. +#define S_INT_MIN (-2147483647 - 1) // -(1 << 31) +#endif // Define this to use mmap() for dictionary loading. Undefine to use malloc() instead of mmap(). // We measured and compared performance of both, and found mmap() is fairly good in terms of |