diff options
author | 2012-04-23 17:45:50 +0900 | |
---|---|---|
committer | 2012-04-23 17:45:50 +0900 | |
commit | 96fb3094aaacf4bae65db54414a7aac285695245 (patch) | |
tree | 108768301b7dfc244ccb68cdfc2a885eb2e27f43 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 5f1d71fbc886bddef6e88549b33beb3b550bec50 (diff) | |
download | latinime-96fb3094aaacf4bae65db54414a7aac285695245.tar.gz latinime-96fb3094aaacf4bae65db54414a7aac285695245.tar.xz latinime-96fb3094aaacf4bae65db54414a7aac285695245.zip |
Fix a bug where a batch edit would not be started.
This would end up in TextView sometimes calling onUpdateSelection
multiple times (this is the correct behavior for TextView). We now
commit the space and the word in a batch edit, and we only get
onUpdateSelection once.
Bug: 6300527
Change-Id: I9579f3d8f5320c1cc24a7a42f19db8e105eb090d
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index e1978fca1..ddc710956 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1793,6 +1793,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen public void pickSuggestionManually(final int index, final CharSequence suggestion, int x, int y) { final SuggestedWords suggestedWords = mSuggestionsView.getSuggestions(); + final InputConnection ic = getCurrentInputConnection(); + if (ic != null) ic.beginBatchEdit(); if (SPACE_STATE_PHANTOM == mSpaceState && suggestion.length() > 0) { int firstChar = Character.codePointAt(suggestion, 0); @@ -1810,7 +1812,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } mKeyboardSwitcher.updateShiftState(); resetComposingState(true /* alsoResetLastComposedWord */); - final InputConnection ic = getCurrentInputConnection(); if (ic != null) { final CompletionInfo completionInfo = mApplicationSpecifiedCompletions[index]; ic.commitCompletion(completionInfo); @@ -1889,6 +1890,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mHandler.postUpdateSuggestions(); } } + if (null != ic) ic.endBatchEdit(); } /** |