Cleanup again (A72)

Change-Id: Id3765bf9826cc2c7ca70158cda53c75dc58f51c6
This commit is contained in:
Jean Chalard 2012-07-06 12:30:09 +09:00
parent 37eaa24b5a
commit 7a422a0142

View file

@ -1663,7 +1663,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void updateSuggestionsOrPredictions() { public void updateSuggestionsOrPredictions() {
mHandler.cancelUpdateSuggestionStrip(); mHandler.cancelUpdateSuggestionStrip();
final boolean isPredictions = !mWordComposer.isComposingWord();
// Check if we have a suggestion engine attached. // Check if we have a suggestion engine attached.
if (mSuggest == null || !mCurrentSettings.isSuggestionsRequested(mDisplayOrientation)) { if (mSuggest == null || !mCurrentSettings.isSuggestionsRequested(mDisplayOrientation)) {
@ -1677,14 +1676,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final CharSequence typedWord; final CharSequence typedWord;
final SuggestedWords suggestions; final SuggestedWords suggestions;
// TODO: cleanup the following, those two mean the same thing if (!mWordComposer.isComposingWord()) {
if (isPredictions || !mWordComposer.isComposingWord()) {
if (!mCurrentSettings.mBigramPredictionEnabled) { if (!mCurrentSettings.mBigramPredictionEnabled) {
setPunctuationSuggestions(); setPunctuationSuggestions();
return; return;
} }
typedWord = ""; typedWord = "";
suggestions = updateBigramPredictions(typedWord); suggestions = updateBigramPredictions();
} else { } else {
typedWord = mWordComposer.getTypedWord(); typedWord = mWordComposer.getTypedWord();
suggestions = updateSuggestions(typedWord); suggestions = updateSuggestions(typedWord);
@ -1892,7 +1890,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
separatorCode, prevWord); separatorCode, prevWord);
} }
private SuggestedWords updateBigramPredictions(final CharSequence typedWord) { private SuggestedWords updateBigramPredictions() {
final CharSequence prevWord = mConnection.getThisWord(mCurrentSettings.mWordSeparators); final CharSequence prevWord = mConnection.getThisWord(mCurrentSettings.mWordSeparators);
return mSuggest.getSuggestedWords(mWordComposer, return mSuggest.getSuggestedWords(mWordComposer,
prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(),