diff options
| author | 2012-01-12 22:51:55 +0900 | |
|---|---|---|
| committer | 2012-01-13 09:45:41 +0900 | |
| commit | c8f4183669c7cf166ced70bf60ad056482f3390b (patch) | |
| tree | b3d179bb4da5dc0b8db895a12e158395ce2237eb | |
| parent | e00274a5ab8d16d1050adda84412016c01a469b3 (diff) | |
Bring LatinIME's privateImeOptions "forceAscii" to a formal public API
bug: 5850605
Change-Id: I6ab6076909c735a3e0729b457de68d0b5301184d
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/view/inputmethod/EditorInfo.java | 16 | ||||
| -rwxr-xr-x | core/res/res/values/attrs.xml | 15 |
3 files changed, 32 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index fa2a475370c3..5a4236e9e2b0 100644 --- a/api/current.txt +++ b/api/current.txt @@ -24618,6 +24618,7 @@ package android.view.inputmethod { field public static final int IME_ACTION_SEARCH = 3; // 0x3 field public static final int IME_ACTION_SEND = 4; // 0x4 field public static final int IME_ACTION_UNSPECIFIED = 0; // 0x0 + field public static final int IME_FLAG_FORCE_ASCII = -2147483648; // 0x80000000 field public static final int IME_FLAG_NAVIGATE_NEXT = 134217728; // 0x8000000 field public static final int IME_FLAG_NAVIGATE_PREVIOUS = 67108864; // 0x4000000 field public static final int IME_FLAG_NO_ACCESSORY_ACTION = 536870912; // 0x20000000 diff --git a/core/java/android/view/inputmethod/EditorInfo.java b/core/java/android/view/inputmethod/EditorInfo.java index ac378fc46bdd..514656752618 100644 --- a/core/java/android/view/inputmethod/EditorInfo.java +++ b/core/java/android/view/inputmethod/EditorInfo.java @@ -168,6 +168,22 @@ public class EditorInfo implements InputType, Parcelable { public static final int IME_FLAG_NO_ENTER_ACTION = 0x40000000; /** + * Flag of {@link #imeOptions}: used to request that the IME is capable of + * inputting ASCII characters. The intention of this flag is to ensure that + * the user can type Roman alphabet characters in a {@link android.widget.TextView} + * used for, typically, account ID or password input. It is expected that IMEs + * normally are able to input ASCII even without being told so (such IMEs + * already respect this flag in a sense), but there could be some cases they + * aren't when, for instance, only non-ASCII input languagaes like Arabic, + * Greek, Hebrew, Russian are enabled in the IME. Applications need to be + * aware that the flag is not a guarantee, and not all IMEs will respect it. + * However, it is strongly recommended for IME authors to respect this flag + * especially when their IME could end up with a state that has only non-ASCII + * input languages enabled. + */ + public static final int IME_FLAG_FORCE_ASCII = 0x80000000; + + /** * Generic unspecified type for {@link #imeOptions}. */ public static final int IME_NULL = 0x00000000; diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index fea852382f08..07fa865908d6 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1154,6 +1154,21 @@ <p>Corresponds to {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_ENTER_ACTION}. --> <flag name="flagNoEnterAction" value="0x40000000" /> + <!-- Used to request that the IME should be capable of inputting ASCII + characters. The intention of this flag is to ensure that the user + can type Roman alphabet characters in a {@link android.widget.TextView} + used for, typically, account ID or password input. It is expected that IMEs + normally are able to input ASCII even without being told so (such IMEs + already respect this flag in a sense), but there could be some cases they + aren't when, for instance, only non-ASCII input languagaes like Arabic, + Greek, Hebrew, Russian are enabled in the IME. Applications need to be + aware that the flag is not a guarantee, and not all IMEs will respect it. + However, it is strongly recommended for IME authors to respect this flag + especially when their IME could end up with a state that has only non-ASCII + input languages enabled. + <p>Corresponds to + {@link android.view.inputmethod.EditorInfo#IME_FLAG_FORCE_ASCII}. --> + <flag name="flagForceAscii" value="0x80000000" /> </attr> <!-- A coordinate in the X dimension. --> |