Merge "Straighten out the last bastion of the Builder"

This commit is contained in:
Jean Chalard 2012-03-13 20:23:16 -07:00 committed by Android (Google) Code Review
commit 76e3861981
2 changed files with 10 additions and 3 deletions

View file

@ -437,13 +437,20 @@ public class Suggest implements Dictionary.WordCallback {
}
// Don't auto-correct words with multiple capital letter
autoCorrectionAvailable &= !wordComposer.isMostlyCaps();
final boolean shouldBlockAutoCorrectionBySatefyNet;
if (allowsToBeAutoCorrected && scoreInfoList.size() > 1 && mAutoCorrectionThreshold > 0
&& Suggest.shouldBlockAutoCorrectionBySafetyNet(typedWord,
scoreInfoList.get(1).mWord)) {
shouldBlockAutoCorrectionBySatefyNet = true;
} else {
shouldBlockAutoCorrectionBySatefyNet = false;
}
builder = new SuggestedWords.Builder(scoreInfoList,
!allowsToBeAutoCorrected /* typedWordValid */,
autoCorrectionAvailable /* hasMinimalSuggestion */,
allowsToBeAutoCorrected /* allowsToBeAutoCorrected */,
false /* isPunctuationSuggestions */);
if (allowsToBeAutoCorrected && builder.size() > 1 && mAutoCorrectionThreshold > 0
&& Suggest.shouldBlockAutoCorrectionBySafetyNet(typedWord, builder.getWord(1))) {
if (shouldBlockAutoCorrectionBySatefyNet) {
builder.setShouldBlockAutoCorrectionBySafetyNet();
}
return builder;

View file

@ -170,7 +170,7 @@ public class SuggestedWords {
}
public static class SuggestedWordInfo {
private final CharSequence mWord;
public final CharSequence mWord;
private final CharSequence mDebugString;
private final boolean mPreviousSuggestedWord;