am 0a0a3cda: Merge "Revert "Revert "Fix a race condition."""

* commit '0a0a3cdad83ae0923c503c394ebdefafff2a217b':
  Revert "Revert "Fix a race condition.""
main
Jean Chalard 2014-01-08 00:37:07 -08:00 committed by Android Git Automerger
commit 614bec1551
1 changed files with 5 additions and 2 deletions

View File

@ -1114,8 +1114,11 @@ public final class InputLogic {
keyboardSwitcher.getKeyboard()); keyboardSwitcher.getKeyboard());
mWordComposer.setCursorPositionWithinWord( mWordComposer.setCursorPositionWithinWord(
typedWord.codePointCount(0, numberOfCharsInWordBeforeCursor)); typedWord.codePointCount(0, numberOfCharsInWordBeforeCursor));
mConnection.setComposingRegion(expectedCursorPosition - numberOfCharsInWordBeforeCursor, // TODO: Change these two lines to setComposingRegion(cursorPosition,
expectedCursorPosition + range.getNumberOfCharsInWordAfterCursor()); // cursorPosition + 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.