Merge "Revert "Fix a race condition.""

main
Ken Wakasa 2014-01-07 23:57:06 +00:00 committed by Android (Google) Code Review
commit 8bd658555d
1 changed files with 2 additions and 5 deletions

View File

@ -1113,11 +1113,8 @@ public final class InputLogic {
keyboardSwitcher.getKeyboard()); keyboardSwitcher.getKeyboard());
mWordComposer.setCursorPositionWithinWord( mWordComposer.setCursorPositionWithinWord(
typedWord.codePointCount(0, numberOfCharsInWordBeforeCursor)); typedWord.codePointCount(0, numberOfCharsInWordBeforeCursor));
// TODO: Change these two lines to setComposingRegion(cursorPosition, mConnection.setComposingRegion(expectedCursorPosition - numberOfCharsInWordBeforeCursor,
// cursorPosition + range.getNumberOfCharsInWordAfterCursor()); expectedCursorPosition + range.getNumberOfCharsInWordAfterCursor());
mConnection.deleteSurroundingText(numberOfCharsInWordBeforeCursor,
typedWord.length() - numberOfCharsInWordBeforeCursor);
mConnection.setComposingText(typedWord, 1);
if (suggestions.isEmpty()) { if (suggestions.isEmpty()) {
// We come here if there weren't any suggestion spans on this word. We will try to // We come here if there weren't any suggestion spans on this word. We will try to
// compute suggestions for it instead. // compute suggestions for it instead.