aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-05-29 08:44:55 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-29 08:44:55 +0000
commit441ae6e8ef3b2e6838a95e00db3ef432ba197a1a (patch)
tree82905dca3c31cf10325f64347747adce8d6ff727 /java
parent28f1d1ead00838236893a81aa58ac877079c83a1 (diff)
parent944923f26660959bfc347c55b66f40de924d3068 (diff)
downloadlatinime-441ae6e8ef3b2e6838a95e00db3ef432ba197a1a.tar.gz
latinime-441ae6e8ef3b2e6838a95e00db3ef432ba197a1a.tar.xz
latinime-441ae6e8ef3b2e6838a95e00db3ef432ba197a1a.zip
am 944923f2: Fix: too many calls to getSuggestedWordsForTypingInput
* commit '944923f26660959bfc347c55b66f40de924d3068': Fix: too many calls to getSuggestedWordsForTypingInput
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java1
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java13
2 files changed, 11 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 9ec697b5e..6c2f17cdd 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -18,7 +18,6 @@ package com.android.inputmethod.latin;
import android.text.TextUtils;
-import com.android.inputmethod.event.Event;
import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import com.android.inputmethod.latin.define.ProductionFlag;
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 2530f64f9..71be18c3d 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -786,10 +786,11 @@ public final class InputLogic {
final int codePoint = inputTransaction.mEvent.mCodePoint;
final SettingsValues settingsValues = inputTransaction.mSettingsValues;
boolean didAutoCorrect = false;
+ final boolean wasComposingWord = mWordComposer.isComposingWord();
// We avoid sending spaces in languages without spaces if we were composing.
final boolean shouldAvoidSendingCode = Constants.CODE_SPACE == codePoint
&& !settingsValues.mSpacingAndPunctuations.mCurrentLanguageHasSpaces
- && mWordComposer.isComposingWord();
+ && wasComposingWord;
if (mWordComposer.isCursorFrontOrMiddleOfComposingWord()) {
// 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.
@@ -840,13 +841,16 @@ public final class InputLogic {
if (Constants.CODE_SPACE == codePoint) {
if (maybeDoubleSpacePeriod(inputTransaction)) {
inputTransaction.requireShiftUpdate(InputTransaction.SHIFT_UPDATE_NOW);
+ inputTransaction.setRequiresUpdateSuggestions();
mSpaceState = SpaceState.DOUBLE;
} else if (!mSuggestedWords.isPunctuationSuggestions()) {
mSpaceState = SpaceState.WEAK;
}
startDoubleSpacePeriodCountdown(inputTransaction);
- inputTransaction.setRequiresUpdateSuggestions();
+ if (wasComposingWord) {
+ inputTransaction.setRequiresUpdateSuggestions();
+ }
} else {
if (swapWeakSpace) {
swapSwapperAndSpace(inputTransaction);
@@ -943,6 +947,11 @@ public final class InputLogic {
if (mConnection.revertDoubleSpacePeriod()) {
// No need to reset mSpaceState, it has already be done (that's why we
// receive it as a parameter)
+ inputTransaction.setRequiresUpdateSuggestions();
+ mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime(
+ WordComposer.CAPS_MODE_OFF,
+ getPrevWordsInfoFromNthPreviousWordForSuggestion(
+ inputTransaction.mSettingsValues.mSpacingAndPunctuations, 1));
return;
}
} else if (SpaceState.SWAP_PUNCTUATION == inputTransaction.mSpaceState) {