diff options
author | 2012-04-19 12:42:13 +0900 | |
---|---|---|
committer | 2012-04-19 19:45:19 +0900 | |
commit | 1cb08acaf3b4d58cbf4cb65f9fc3990b39e33f00 (patch) | |
tree | f08afa5916d53c029c53b78a1703834d65c9b005 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | c27fe6253c1d8b3ad3c2f891a48ec5c54d77a3f1 (diff) | |
download | latinime-1cb08acaf3b4d58cbf4cb65f9fc3990b39e33f00.tar.gz latinime-1cb08acaf3b4d58cbf4cb65f9fc3990b39e33f00.tar.xz latinime-1cb08acaf3b4d58cbf4cb65f9fc3990b39e33f00.zip |
Add Constants class to hold public constants
This change also gets rid of compiler warnings about "deprecations".
Change-Id: Id9b83483c453a81ebac34b684656db05e3599657
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 56 |
1 files changed, 8 insertions, 48 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 9cfde8b77..31c832c31 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -16,6 +16,10 @@ package com.android.inputmethod.latin; +import static com.android.inputmethod.latin.Constants.ImeOption.FORCE_ASCII; +import static com.android.inputmethod.latin.Constants.ImeOption.NO_MICROPHONE; +import static com.android.inputmethod.latin.Constants.ImeOption.NO_MICROPHONE_COMPAT; + import android.app.AlertDialog; import android.content.BroadcastReceiver; import android.content.Context; @@ -81,49 +85,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private static final boolean TRACE = false; private static boolean DEBUG; - /** - * The private IME option used to indicate that no microphone should be - * shown for a given text field. For instance, this is specified by the - * search dialog when the dialog is already showing a voice search button. - * - * @deprecated Use {@link LatinIME#IME_OPTION_NO_MICROPHONE} with package name prefixed. - */ - @SuppressWarnings("dep-ann") - public static final String IME_OPTION_NO_MICROPHONE_COMPAT = "nm"; - - /** - * The private IME option used to indicate that no microphone should be - * shown for a given text field. For instance, this is specified by the - * search dialog when the dialog is already showing a voice search button. - */ - public static final String IME_OPTION_NO_MICROPHONE = "noMicrophoneKey"; - - /** - * The private IME option used to indicate that no settings key should be - * shown for a given text field. - */ - public static final String IME_OPTION_NO_SETTINGS_KEY = "noSettingsKey"; - - /** - * The private IME option used to indicate that the given text field needs - * ASCII code points input. - * - * @deprecated Use {@link EditorInfo#IME_FLAG_FORCE_ASCII}. - */ - @SuppressWarnings("dep-ann") - public static final String IME_OPTION_FORCE_ASCII = "forceAscii"; - - /** - * The subtype extra value used to indicate that the subtype keyboard layout set name. - */ - public static final String SUBTYPE_EXTRA_VALUE_KEYBOARD_LAYOUT_SET = "KeyboardLayoutSet"; - - /** - * The subtype extra value used to indicate that the subtype keyboard layout is capable for - * typing ASCII characters. - */ - public static final String SUBTYPE_EXTRA_VALUE_ASCII_CAPABLE = "AsciiCapable"; - private static final int EXTENDED_TOUCHABLE_REGION_HEIGHT = 100; // How many continuous deletes at which to start deleting at a higher speed. @@ -649,6 +610,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen super.onStartInput(editorInfo, restarting); } + @SuppressWarnings("deprecation") private void onStartInputViewInternal(EditorInfo editorInfo, boolean restarting) { super.onStartInputView(editorInfo, restarting); final KeyboardSwitcher switcher = mKeyboardSwitcher; @@ -669,14 +631,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.latinIME_onStartInputViewInternal(editorInfo); } - if (InputAttributes.inPrivateImeOptions( - null, IME_OPTION_NO_MICROPHONE_COMPAT, editorInfo)) { + if (InputAttributes.inPrivateImeOptions(null, NO_MICROPHONE_COMPAT, editorInfo)) { Log.w(TAG, "Deprecated private IME option specified: " + editorInfo.privateImeOptions); - Log.w(TAG, "Use " + getPackageName() + "." + IME_OPTION_NO_MICROPHONE + " instead"); + Log.w(TAG, "Use " + getPackageName() + "." + NO_MICROPHONE + " instead"); } - if (InputAttributes.inPrivateImeOptions( - getPackageName(), IME_OPTION_FORCE_ASCII, editorInfo)) { + if (InputAttributes.inPrivateImeOptions(getPackageName(), FORCE_ASCII, editorInfo)) { Log.w(TAG, "Deprecated private IME option specified: " + editorInfo.privateImeOptions); Log.w(TAG, "Use EditorInfo.IME_FLAG_FORCE_ASCII flag instead"); |