diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index d4aab409f..b68d48246 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -186,7 +186,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private InputMethodManagerCompatWrapper mImm; private Resources mResources; private SharedPreferences mPrefs; - private String mInputMethodId; private KeyboardSwitcher mKeyboardSwitcher; private SubtypeSwitcher mSubtypeSwitcher; private VoiceProxy mVoiceProxy; @@ -496,7 +495,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar super.onCreate(); mImm = InputMethodManagerCompatWrapper.getInstance(); - mInputMethodId = Utils.getInputMethodId(mImm, getPackageName()); mSubtypeSwitcher = SubtypeSwitcher.getInstance(); mKeyboardSwitcher = KeyboardSwitcher.getInstance(); mVibrator = VibratorCompatWrapper.getInstance(this); @@ -738,8 +736,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mSubtypeSwitcher.updateParametersOnStartInputView(); - TextEntryState.reset(); - // Most such things we decide below in initializeInputAttributesAndGetMode, but we need to // know now whether this is a password text field, because we need to know now whether we // want to enable the voice button. @@ -932,7 +928,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar && (selectionChanged || candidatesCleared)) { mWordComposer.reset(); mHasUncommittedTypedChars = false; - TextEntryState.reset(); updateSuggestions(); final InputConnection ic = getCurrentInputConnection(); if (ic != null) { @@ -941,7 +936,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mComposingStateManager.onFinishComposingText(); mVoiceProxy.setVoiceInputHighlighted(false); } else if (!mHasUncommittedTypedChars) { - TextEntryState.reset(); updateSuggestions(); } } @@ -1149,7 +1143,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (ic != null) { ic.commitText(typedWord, 1); } - TextEntryState.acceptedTyped(typedWord); addToUserUnigramAndBigramDictionaries(typedWord, UserUnigramDictionary.FREQUENCY_FOR_TYPED); } @@ -1427,8 +1420,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } mHandler.postUpdateShiftKeyState(); - // TODO: Merge space state with TextEntryState - TextEntryState.backspace(); if (null != mWordSavedForAutoCorrectCancellation) { Utils.Stats.onAutoCorrectionCancellation(); cancelAutoCorrect(ic); @@ -1575,10 +1566,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar switcher.updateShiftState(); if (mSettingsValues.isWordSeparator(code)) { - TextEntryState.typedCharacter((char) code, true, x, y); Utils.Stats.onSeparator((char)code, x, y); } else { - TextEntryState.typedCharacter((char) code, false, x, y); Utils.Stats.onNonSeparator((char)code, x, y); } if (null != ic) ic.endBatchEdit(); @@ -1662,12 +1651,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar setPunctuationSuggestions(); } - TextEntryState.typedCharacter((char) primaryCode, true, x, y); Utils.Stats.onSeparator((char)primaryCode, x, y); if (pickedDefault) { CharSequence typedWord = mWordComposer.getTypedWord(); - TextEntryState.backToAcceptedDefault(typedWord); if (!TextUtils.isEmpty(typedWord) && !typedWord.equals(mBestWord)) { InputConnectionCompatUtils.commitCorrection( ic, mLastSelectionEnd - typedWord.length(), typedWord, mBestWord); @@ -1877,8 +1864,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (mBestWord != null && mBestWord.length() > 0) { Utils.Stats.onAutoCorrection(mWordComposer.getTypedWord(), mBestWord.toString(), separatorCode); - TextEntryState.acceptedDefault(mWordComposer.getTypedWord(), mBestWord, - separatorCode); mExpectingUpdateSelection = true; commitBestWord(mBestWord); if (!mBestWord.equals(mWordComposer.getTypedWord())) { @@ -1959,7 +1944,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } LatinImeLogger.logOnManualSuggestion(mWordComposer.getTypedWord().toString(), suggestion.toString(), index, suggestions.mWords); - TextEntryState.acceptedSuggestion(mWordComposer.getTypedWord().toString(), suggestion); // Follow it with a space if (mInsertSpaceOnPickSuggestionManually) { sendMagicSpace(); @@ -1981,11 +1965,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar || !AutoCorrection.isValidWord( mSuggest.getUnigramDictionaries(), suggestion, true)); - // Fool the state watcher so that a subsequent backspace will not do a revert, unless - // we just did a correction, in which case we need to stay in - // TextEntryState.State.PICKED_SUGGESTION state. - TextEntryState.typedCharacter((char) Keyboard.CODE_SPACE, true, - WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE); Utils.Stats.onSeparator((char)Keyboard.CODE_SPACE, WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE); if (!showingAddToDictionaryHint) { @@ -2174,7 +2153,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mBestWord = null; mHasUncommittedTypedChars = true; mComposingStateManager.onStartComposingText(); - TextEntryState.restartSuggestionsOnWordBeforeCursor(); ic.deleteSurroundingText(word.length(), 0); ic.setComposingText(word, 1); mHandler.postUpdateSuggestions(); @@ -2203,10 +2181,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // Re-insert the separator ic.commitText(mWordComposer.getTypedWord(), 1); - TextEntryState.acceptedTyped(mWordComposer.getTypedWord()); ic.commitText(separator, 1); - TextEntryState.typedCharacter(separator.charAt(0), true, - WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE); Utils.Stats.onSeparator(separator.charAt(0), WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE); mHandler.cancelUpdateBigramPredictions(); @@ -2237,7 +2212,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // the old WordComposer allows to reuse the actual typed coordinates. mHasUncommittedTypedChars = true; ic.setComposingText(mWordComposer.getTypedWord(), 1); - TextEntryState.backspace(); mHandler.cancelUpdateBigramPredictions(); mHandler.postUpdateSuggestions(); } @@ -2462,7 +2436,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar switch (position) { case 0: Intent intent = CompatUtils.getInputLanguageSelectionIntent( - mInputMethodId, Intent.FLAG_ACTIVITY_NEW_TASK + Utils.getInputMethodId(mImm, getPackageName()), + Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); @@ -2520,7 +2495,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar p.println(" mAutoCorrectEnabled=" + mSettingsValues.mAutoCorrectEnabled); p.println(" mInsertSpaceOnPickSuggestionManually=" + mInsertSpaceOnPickSuggestionManually); p.println(" mApplicationSpecifiedCompletionOn=" + mApplicationSpecifiedCompletionOn); - p.println(" TextEntryState.state=" + TextEntryState.getState()); p.println(" mSoundOn=" + mSettingsValues.mSoundOn); p.println(" mVibrateOn=" + mSettingsValues.mVibrateOn); p.println(" mKeyPreviewPopupOn=" + mSettingsValues.mKeyPreviewPopupOn); |