Merge "Fix a bug where a batch edit would not be started."

main
Jean Chalard 2012-04-23 17:02:41 -07:00 committed by Android (Google) Code Review
commit 5ee0ee0dbe
1 changed files with 3 additions and 1 deletions

View File

@ -1793,6 +1793,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void pickSuggestionManually(final int index, final CharSequence suggestion, public void pickSuggestionManually(final int index, final CharSequence suggestion,
int x, int y) { int x, int y) {
final SuggestedWords suggestedWords = mSuggestionsView.getSuggestions(); final SuggestedWords suggestedWords = mSuggestionsView.getSuggestions();
final InputConnection ic = getCurrentInputConnection();
if (ic != null) ic.beginBatchEdit();
if (SPACE_STATE_PHANTOM == mSpaceState && suggestion.length() > 0) { if (SPACE_STATE_PHANTOM == mSpaceState && suggestion.length() > 0) {
int firstChar = Character.codePointAt(suggestion, 0); int firstChar = Character.codePointAt(suggestion, 0);
@ -1810,7 +1812,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
} }
mKeyboardSwitcher.updateShiftState(); mKeyboardSwitcher.updateShiftState();
resetComposingState(true /* alsoResetLastComposedWord */); resetComposingState(true /* alsoResetLastComposedWord */);
final InputConnection ic = getCurrentInputConnection();
if (ic != null) { if (ic != null) {
final CompletionInfo completionInfo = mApplicationSpecifiedCompletions[index]; final CompletionInfo completionInfo = mApplicationSpecifiedCompletions[index];
ic.commitCompletion(completionInfo); ic.commitCompletion(completionInfo);
@ -1889,6 +1890,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mHandler.postUpdateSuggestions(); mHandler.postUpdateSuggestions();
} }
} }
if (null != ic) ic.endBatchEdit();
} }
/** /**