diff --git a/api/current.txt b/api/current.txt index 6937087b86dc2..873957b411d44 100644 --- a/api/current.txt +++ b/api/current.txt @@ -45099,6 +45099,7 @@ package android.view.inputmethod { field public static final int IME_FLAG_NO_ENTER_ACTION = 1073741824; // 0x40000000 field public static final int IME_FLAG_NO_EXTRACT_UI = 268435456; // 0x10000000 field public static final int IME_FLAG_NO_FULLSCREEN = 33554432; // 0x2000000 + field public static final int IME_FLAG_NO_PERSONALIZED_LEARNING = 16777216; // 0x1000000 field public static final int IME_MASK_ACTION = 255; // 0xff field public static final int IME_NULL = 0; // 0x0 field public int actionId; diff --git a/api/system-current.txt b/api/system-current.txt index de033bd00bde7..88f25a8da94ec 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -48269,6 +48269,7 @@ package android.view.inputmethod { field public static final int IME_FLAG_NO_ENTER_ACTION = 1073741824; // 0x40000000 field public static final int IME_FLAG_NO_EXTRACT_UI = 268435456; // 0x10000000 field public static final int IME_FLAG_NO_FULLSCREEN = 33554432; // 0x2000000 + field public static final int IME_FLAG_NO_PERSONALIZED_LEARNING = 16777216; // 0x1000000 field public static final int IME_MASK_ACTION = 255; // 0xff field public static final int IME_NULL = 0; // 0x0 field public int actionId; diff --git a/api/test-current.txt b/api/test-current.txt index d66e9c079ff6e..5d088322d3f1d 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -45346,6 +45346,7 @@ package android.view.inputmethod { field public static final int IME_FLAG_NO_ENTER_ACTION = 1073741824; // 0x40000000 field public static final int IME_FLAG_NO_EXTRACT_UI = 268435456; // 0x10000000 field public static final int IME_FLAG_NO_FULLSCREEN = 33554432; // 0x2000000 + field public static final int IME_FLAG_NO_PERSONALIZED_LEARNING = 16777216; // 0x1000000 field public static final int IME_MASK_ACTION = 255; // 0xff field public static final int IME_NULL = 0; // 0x0 field public int actionId; diff --git a/core/java/android/view/inputmethod/EditorInfo.java b/core/java/android/view/inputmethod/EditorInfo.java index 80380897fd398..2f12e9b5be839 100644 --- a/core/java/android/view/inputmethod/EditorInfo.java +++ b/core/java/android/view/inputmethod/EditorInfo.java @@ -33,6 +33,54 @@ import java.util.Arrays; * importantly the type of text content it contains and the current cursor position. */ public class EditorInfo implements InputType, Parcelable { + /** + * Masks for {@link inputType} + * + *
+ * |-------|-------|-------|-------| + * 1111 TYPE_MASK_CLASS + * 11111111 TYPE_MASK_VARIATION + * 111111111111 TYPE_MASK_FLAGS + * |-------|-------|-------|-------| + * TYPE_NULL + * |-------|-------|-------|-------| + * 1 TYPE_CLASS_TEXT + * 1 TYPE_TEXT_VARIATION_URI + * 1 TYPE_TEXT_VARIATION_EMAIL_ADDRESS + * 11 TYPE_TEXT_VARIATION_EMAIL_SUBJECT + * 1 TYPE_TEXT_VARIATION_SHORT_MESSAGE + * 1 1 TYPE_TEXT_VARIATION_LONG_MESSAGE + * 11 TYPE_TEXT_VARIATION_PERSON_NAME + * 111 TYPE_TEXT_VARIATION_POSTAL_ADDRESS + * 1 TYPE_TEXT_VARIATION_PASSWORD + * 1 1 TYPE_TEXT_VARIATION_VISIBLE_PASSWORD + * 1 1 TYPE_TEXT_VARIATION_WEB_EDIT_TEXT + * 1 11 TYPE_TEXT_VARIATION_FILTER + * 11 TYPE_TEXT_VARIATION_PHONETIC + * 11 1 TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS + * 111 TYPE_TEXT_VARIATION_WEB_PASSWORD + * 1 TYPE_TEXT_FLAG_CAP_CHARACTERS + * 1 TYPE_TEXT_FLAG_CAP_WORDS + * 1 TYPE_TEXT_FLAG_CAP_SENTENCES + * 1 TYPE_TEXT_FLAG_AUTO_CORRECT + * 1 TYPE_TEXT_FLAG_AUTO_COMPLETE + * 1 TYPE_TEXT_FLAG_MULTI_LINE + * 1 TYPE_TEXT_FLAG_IME_MULTI_LINE + * 1 TYPE_TEXT_FLAG_NO_SUGGESTIONS + * |-------|-------|-------|-------| + * 1 TYPE_CLASS_NUMBER + * 1 TYPE_NUMBER_VARIATION_PASSWORD + * 1 TYPE_NUMBER_FLAG_SIGNED + * 1 TYPE_NUMBER_FLAG_DECIMAL + * |-------|-------|-------|-------| + * 11 TYPE_CLASS_PHONE + * |-------|-------|-------|-------| + * 1 TYPE_CLASS_DATETIME + * 1 TYPE_DATETIME_VARIATION_DATE + * 1 TYPE_DATETIME_VARIATION_TIME + * |-------|-------|-------|-------|+ */ + /** * The content type of the text box, whose bits are defined by * {@link InputType}. @@ -106,6 +154,26 @@ public class EditorInfo implements InputType, Parcelable { */ public static final int IME_ACTION_PREVIOUS = 0x00000007; + /** + * Flag of {@link #imeOptions}: used to request that the IME does not update any personalized + * data such as typing history and personalized language model based on what the user typed on + * this text editing object. Typical use cases are: + *
Applications need to be aware that the flag is not a guarantee, and some IMEs may not + * respect it.
+ */ + public static final int IME_FLAG_NO_PERSONALIZED_LEARNING = 0x1000000; + /** * Flag of {@link #imeOptions}: used to request that the IME never go * into fullscreen mode. @@ -207,6 +275,32 @@ public class EditorInfo implements InputType, Parcelable { */ public static final int IME_NULL = 0x00000000; + /** + * Masks for {@link imeOptions} + * + *+ * |-------|-------|-------|-------| + * 1111 IME_MASK_ACTION + * |-------|-------|-------|-------| + * IME_ACTION_UNSPECIFIED + * 1 IME_ACTION_NONE + * 1 IME_ACTION_GO + * 11 IME_ACTION_SEARCH + * 1 IME_ACTION_SEND + * 1 1 IME_ACTION_NEXT + * 11 IME_ACTION_DONE + * 111 IME_ACTION_PREVIOUS + * 1 IME_FLAG_NO_PERSONALIZED_LEARNING + * 1 IME_FLAG_NO_FULLSCREEN + * 1 IME_FLAG_NAVIGATE_PREVIOUS + * 1 IME_FLAG_NAVIGATE_NEXT + * 1 IME_FLAG_NO_EXTRACT_UI + * 1 IME_FLAG_NO_ACCESSORY_ACTION + * 1 IME_FLAG_NO_ENTER_ACTION + * 1 IME_FLAG_FORCE_ASCII + * |-------|-------|-------|-------|+ */ + /** * Extended type information for the editor, to help the IME better * integrate with it.