am 2df6374f: Merge "Fix: too many calls to getSuggestedWordsForTypingInput"

* commit '2df6374ffa1474358c2fdcb99a8e767378f747cf':
  Fix: too many calls to getSuggestedWordsForTypingInput
main
Jean Chalard 2014-05-22 03:16:41 +00:00 committed by Android Git Automerger
commit 368549eda7
2 changed files with 6 additions and 4 deletions

View File

@ -18,7 +18,6 @@ package com.android.inputmethod.latin;
import android.text.TextUtils; import android.text.TextUtils;
import com.android.inputmethod.event.Event;
import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.define.ProductionFlag;

View File

@ -805,10 +805,11 @@ public final class InputLogic {
final int codePoint = inputTransaction.mEvent.mCodePoint; final int codePoint = inputTransaction.mEvent.mCodePoint;
final SettingsValues settingsValues = inputTransaction.mSettingsValues; final SettingsValues settingsValues = inputTransaction.mSettingsValues;
boolean didAutoCorrect = false; boolean didAutoCorrect = false;
final boolean wasComposingWord = mWordComposer.isComposingWord();
// We avoid sending spaces in languages without spaces if we were composing. // We avoid sending spaces in languages without spaces if we were composing.
final boolean shouldAvoidSendingCode = Constants.CODE_SPACE == codePoint final boolean shouldAvoidSendingCode = Constants.CODE_SPACE == codePoint
&& !settingsValues.mSpacingAndPunctuations.mCurrentLanguageHasSpaces && !settingsValues.mSpacingAndPunctuations.mCurrentLanguageHasSpaces
&& mWordComposer.isComposingWord(); && wasComposingWord;
if (mWordComposer.isCursorFrontOrMiddleOfComposingWord()) { if (mWordComposer.isCursorFrontOrMiddleOfComposingWord()) {
// If we are in the middle of a recorrection, we need to commit the recorrection // If we are in the middle of a recorrection, we need to commit the recorrection
// first so that we can insert the separator at the current cursor position. // first so that we can insert the separator at the current cursor position.
@ -852,7 +853,7 @@ public final class InputLogic {
promotePhantomSpace(settingsValues); promotePhantomSpace(settingsValues);
} }
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
ResearchLogger.latinIME_handleSeparator(codePoint, mWordComposer.isComposingWord()); ResearchLogger.latinIME_handleSeparator(codePoint, wasComposingWord);
} }
if (!shouldAvoidSendingCode) { if (!shouldAvoidSendingCode) {
@ -868,7 +869,9 @@ public final class InputLogic {
} }
startDoubleSpacePeriodCountdown(inputTransaction); startDoubleSpacePeriodCountdown(inputTransaction);
inputTransaction.setRequiresUpdateSuggestions(); if (wasComposingWord) {
inputTransaction.setRequiresUpdateSuggestions();
}
} else { } else {
if (swapWeakSpace) { if (swapWeakSpace) {
swapSwapperAndSpace(inputTransaction); swapSwapperAndSpace(inputTransaction);