Code simplification (A69)
Change-Id: I2a77e437795fbbea47fd2e604ee6c26f8d0e458a
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index bb83ba6..c8fdbca 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -217,9 +217,9 @@
}
}
- public void postUpdateSuggestionStrip(final boolean isComposing) {
+ public void postUpdateSuggestionStrip() {
cancelUpdateSuggestionStrip();
- if (isComposing) {
+ if (getOuterInstance().mWordComposer.isComposingWord()) {
sendMessageDelayed(obtainMessage(MSG_UPDATE_SUGGESTIONS), mDelayUpdateSuggestions);
} else {
sendMessageDelayed(obtainMessage(MSG_SET_BIGRAM_PREDICTIONS),
@@ -1394,7 +1394,7 @@
mWordComposer.deleteLast();
}
mConnection.setComposingText(getTextWithUnderline(mWordComposer.getTypedWord()), 1);
- mHandler.postUpdateSuggestionStrip(mWordComposer.isComposingWord());
+ mHandler.postUpdateSuggestionStrip();
} else {
mConnection.deleteSurroundingText(1, 0);
if (ProductionFlag.IS_EXPERIMENTAL) {
@@ -1550,7 +1550,7 @@
// In case the "add to dictionary" hint was still displayed.
if (null != mSuggestionsView) mSuggestionsView.dismissAddToDictionaryHint();
}
- mHandler.postUpdateSuggestionStrip(mWordComposer.isComposingWord());
+ mHandler.postUpdateSuggestionStrip();
Utils.Stats.onNonSeparator((char)primaryCode, x, y);
}
@@ -1592,7 +1592,7 @@
mHandler.startDoubleSpacesTimer();
if (!mConnection.isCursorTouchingWord(mCurrentSettings)) {
- mHandler.postUpdateSuggestionStrip(mWordComposer.isComposingWord());
+ mHandler.postUpdateSuggestionStrip();
}
} else {
if (swapWeakSpace) {
@@ -1877,7 +1877,7 @@
mSuggestionsView.showAddToDictionaryHint(suggestion, mCurrentSettings.mHintToSaveText);
} else {
// If we're not showing the "Touch again to save", then update the suggestion strip.
- mHandler.postUpdateSuggestionStrip(mWordComposer.isComposingWord());
+ mHandler.postUpdateSuggestionStrip();
}
}
@@ -1969,7 +1969,7 @@
ResearchLogger.latinIME_deleteSurroundingText(length);
}
mConnection.setComposingText(word, 1);
- mHandler.postUpdateSuggestionStrip(mWordComposer.isComposingWord());
+ mHandler.postUpdateSuggestionStrip();
}
private void revertCommit() {
@@ -2014,7 +2014,7 @@
// separator.
mLastComposedWord = LastComposedWord.NOT_A_COMPOSED_WORD;
// We have a separator between the word and the cursor: we should show predictions.
- mHandler.postUpdateSuggestionStrip(mWordComposer.isComposingWord());
+ mHandler.postUpdateSuggestionStrip();
}
public boolean isWordSeparator(int code) {
@@ -2039,7 +2039,7 @@
// Since we just changed languages, we should re-evaluate suggestions with whatever word
// we are currently composing. If we are not composing anything, we may want to display
// predictions or punctuation signs (which is done by the updateSuggestionStrip anyway).
- mHandler.postUpdateSuggestionStrip(mWordComposer.isComposingWord());
+ mHandler.postUpdateSuggestionStrip();
}
// TODO: Remove this method from {@link LatinIME} and move {@link FeedbackManager} to