diff options
author | 2012-06-08 23:02:37 +0900 | |
---|---|---|
committer | 2012-06-13 07:02:07 +0900 | |
commit | 9d71748ba48dbc8793f3e1ecddf5fd31b8e59613 (patch) | |
tree | 80f80db9146c289c74a1fc3824de1a63ce08954b /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | c7564a787ea3d6722d763575928cd2631fda6277 (diff) | |
download | latinime-9d71748ba48dbc8793f3e1ecddf5fd31b8e59613.tar.gz latinime-9d71748ba48dbc8793f3e1ecddf5fd31b8e59613.tar.xz latinime-9d71748ba48dbc8793f3e1ecddf5fd31b8e59613.zip |
Fix an occurrence of nested batch edits.
This is harmless, but against policy.
Also, rework the checking code to be more readable, give more
information, and be called for all relevant methods - and not
for informative methods, which are not required to be in a
batch edit.
Change-Id: I03fa8b2e7d68a6a133f86be8a214671750c29256
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 5236591f6..00d4dfe93 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1804,14 +1804,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @Override public void pickSuggestionManually(final int index, final CharSequence suggestion, - int x, int y) { - mConnection.beginBatchEdit(getCurrentInputConnection()); - pickSuggestionManuallyWhileInBatchEdit(index, suggestion, x, y); - mConnection.endBatchEdit(); - } - - public void pickSuggestionManuallyWhileInBatchEdit(final int index, - final CharSequence suggestion, final int x, final int y) { + final int x, final int y) { final SuggestedWords suggestedWords = mSuggestionsView.getSuggestions(); // If this is a punctuation picked from the suggestion strip, pass it to onCodeInput if (suggestion.length() == 1 && isShowingPunctuationList()) { @@ -1846,7 +1839,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mKeyboardSwitcher.updateShiftState(); resetComposingState(true /* alsoResetLastComposedWord */); final CompletionInfo completionInfo = mApplicationSpecifiedCompletions[index]; + mConnection.beginBatchEdit(getCurrentInputConnection()); mConnection.commitCompletion(completionInfo); + mConnection.endBatchEdit(); if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.latinIME_pickApplicationSpecifiedCompletion(index, completionInfo.getText(), x, y); |