Make the safety net memory private

Change-Id: I10959d47c980d2e8f2ea995955acf02193e3ff7b
This commit is contained in:
Jean Chalard 2012-03-09 22:01:15 +09:00
parent ebbb7e9665
commit 68823ae08e
2 changed files with 4 additions and 4 deletions

View File

@ -1845,8 +1845,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
public void showSuggestions(final SuggestedWords suggestedWords, final CharSequence typedWord) { public void showSuggestions(final SuggestedWords suggestedWords, final CharSequence typedWord) {
final CharSequence autoCorrection; final CharSequence autoCorrection;
if (suggestedWords.size() > 0) { if (suggestedWords.size() > 0) {
if (!suggestedWords.mShouldBlockAutoCorrectionBySafetyNet if (suggestedWords.hasAutoCorrectionWord()) {
&& suggestedWords.hasAutoCorrectionWord()) {
autoCorrection = suggestedWords.getWord(1); autoCorrection = suggestedWords.getWord(1);
} else { } else {
autoCorrection = typedWord; autoCorrection = typedWord;

View File

@ -33,7 +33,7 @@ public class SuggestedWords {
public final boolean mTypedWordValid; public final boolean mTypedWordValid;
public final boolean mHasAutoCorrectionCandidate; public final boolean mHasAutoCorrectionCandidate;
public final boolean mIsPunctuationSuggestions; public final boolean mIsPunctuationSuggestions;
public final boolean mShouldBlockAutoCorrectionBySafetyNet; private final boolean mShouldBlockAutoCorrectionBySafetyNet;
private final List<SuggestedWordInfo> mSuggestedWordInfoList; private final List<SuggestedWordInfo> mSuggestedWordInfoList;
SuggestedWords(List<CharSequence> words, boolean typedWordValid, SuggestedWords(List<CharSequence> words, boolean typedWordValid,
@ -65,7 +65,8 @@ public class SuggestedWords {
} }
public boolean hasAutoCorrectionWord() { public boolean hasAutoCorrectionWord() {
return mHasAutoCorrectionCandidate && size() > 1 && !mTypedWordValid; return !mShouldBlockAutoCorrectionBySafetyNet
&& mHasAutoCorrectionCandidate && size() > 1 && !mTypedWordValid;
} }
public boolean willAutoCorrect() { public boolean willAutoCorrect() {