diff options
author | 2012-07-05 11:43:03 +0900 | |
---|---|---|
committer | 2012-07-06 13:07:30 +0900 | |
commit | 0e9e7e337defe97d4ede8c59d0e925f5401f9292 (patch) | |
tree | 712a9a4900a7ff6733e944b85380b7aca10c91c1 /java/src | |
parent | 29eeef75ec6987f7cd82c70ba162376b77e4fde5 (diff) | |
download | latinime-0e9e7e337defe97d4ede8c59d0e925f5401f9292.tar.gz latinime-0e9e7e337defe97d4ede8c59d0e925f5401f9292.tar.xz latinime-0e9e7e337defe97d4ede8c59d0e925f5401f9292.zip |
Cleanup (A57)
We stopped cancelling manual picks a few weeks ago. This code
is dead.
Change-Id: I4032fcc3c95e9379f1839fe860a1b8a9bd7d0bc7
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LastComposedWord.java | 4 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 25 |
2 files changed, 11 insertions, 18 deletions
diff --git a/java/src/com/android/inputmethod/latin/LastComposedWord.java b/java/src/com/android/inputmethod/latin/LastComposedWord.java index 318aecb50..974af2584 100644 --- a/java/src/com/android/inputmethod/latin/LastComposedWord.java +++ b/java/src/com/android/inputmethod/latin/LastComposedWord.java @@ -73,10 +73,10 @@ public class LastComposedWord { } public boolean canRevertCommit() { - return mActive && !TextUtils.isEmpty(mCommittedWord); + return mActive && !TextUtils.isEmpty(mCommittedWord) && !didCommitTypedWord(); } - public boolean didCommitTypedWord() { + private boolean didCommitTypedWord() { return TextUtils.equals(mTypedWord, mCommittedWord); } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 80dda9c19..90e4fcf89 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2000,23 +2000,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mUserHistoryDictionary.cancelAddingUserHistory( previousWord.toString(), committedWord.toString()); } - if (0 == separatorLength || mLastComposedWord.didCommitTypedWord()) { - // This is the case when we cancel a manual pick. - // We should restart suggestion on the word right away. - mWordComposer.resumeSuggestionOnLastComposedWord(mLastComposedWord); - mConnection.setComposingText(originallyTypedWord, 1); - } else { - mConnection.commitText(originallyTypedWord, 1); - // Re-insert the separator - sendKeyCodePoint(mLastComposedWord.mSeparatorCode); - Utils.Stats.onSeparator(mLastComposedWord.mSeparatorCode, WordComposer.NOT_A_COORDINATE, - WordComposer.NOT_A_COORDINATE); - if (ProductionFlag.IS_EXPERIMENTAL) { - ResearchLogger.latinIME_revertCommit(originallyTypedWord); - } - // Don't restart suggestion yet. We'll restart if the user deletes the - // separator. + mConnection.commitText(originallyTypedWord, 1); + // Re-insert the separator + sendKeyCodePoint(mLastComposedWord.mSeparatorCode); + Utils.Stats.onSeparator(mLastComposedWord.mSeparatorCode, WordComposer.NOT_A_COORDINATE, + WordComposer.NOT_A_COORDINATE); + if (ProductionFlag.IS_EXPERIMENTAL) { + ResearchLogger.latinIME_revertCommit(originallyTypedWord); } + // Don't restart suggestion yet. We'll restart if the user deletes the + // separator. mLastComposedWord = LastComposedWord.NOT_A_COMPOSED_WORD; mHandler.postUpdateSuggestions(); } |