Skip to content
Snippets Groups Projects
Commit 08adb09e authored by Jean Chalard's avatar Jean Chalard
Browse files

Remove unused stuff.

Remove 2 methods that were left only for tests to compile in
another project, but are not used any more now that the tests
have been updated.
Also remove an attribute that is never read.

Change-Id: Ic9ba1f52a465199c82c923d77ed7450460e8a4b9
parent 9ffaae71
No related branches found
No related tags found
No related merge requests found
......@@ -271,8 +271,7 @@ public class Suggest implements Dictionary.WordCallback {
return new SuggestedWords.Builder()
.setWords(SuggestedWords.Builder.getFromCharSequenceList(mSuggestions))
.setAllowsToBeAutoCorrected(false)
.setHasAutoCorrection(false);
.setAllowsToBeAutoCorrected(false);
}
// TODO: cleanup dictionaries looking up and suggestions building with SuggestedWords.Builder
......@@ -425,13 +424,11 @@ public class Suggest implements Dictionary.WordCallback {
"--", false));
}
builder = new SuggestedWords.Builder().setWords(scoreInfoList)
.setAllowsToBeAutoCorrected(allowsToBeAutoCorrected)
.setHasAutoCorrection(hasAutoCorrection);
.setAllowsToBeAutoCorrected(allowsToBeAutoCorrected);
} else {
builder = new SuggestedWords.Builder()
.setWords(SuggestedWords.Builder.getFromCharSequenceList(mSuggestions))
.setAllowsToBeAutoCorrected(allowsToBeAutoCorrected)
.setHasAutoCorrection(hasAutoCorrection);
.setAllowsToBeAutoCorrected(allowsToBeAutoCorrected);
}
boolean autoCorrectionAvailable = hasAutoCorrection;
......
......@@ -79,7 +79,6 @@ public class SuggestedWords {
private boolean mIsPunctuationSuggestions;
private boolean mShouldBlockAutoCorrectionBySafetyNet;
private boolean mAllowsToBeAutoCorrected;
private boolean mHasAutoCorrection;
private List<SuggestedWordInfo> mSuggestedWordInfoList =
new ArrayList<SuggestedWordInfo>();
......@@ -87,25 +86,11 @@ public class SuggestedWords {
// Nothing to do here.
}
// TODO: compatibility for tests. Remove this once tests are okay.
public Builder addWords(List<SuggestedWordInfo> suggestedWordInfoList) {
return setWords(suggestedWordInfoList);
}
public Builder setWords(List<SuggestedWordInfo> suggestedWordInfoList) {
mSuggestedWordInfoList = suggestedWordInfoList;
return this;
}
/* package for tests */
Builder addWord(CharSequence word, SuggestedWordInfo suggestedWordInfo) {
if (!TextUtils.isEmpty(suggestedWordInfo.mWord)) {
// It's okay if suggestedWordInfo is null since it's checked where it's used.
mSuggestedWordInfoList.add(suggestedWordInfo);
}
return this;
}
public static List<SuggestedWordInfo> getFromCharSequenceList(
final List<CharSequence> wordList) {
final ArrayList<SuggestedWordInfo> result = new ArrayList<SuggestedWordInfo>();
......@@ -149,11 +134,6 @@ public class SuggestedWords {
return this;
}
public Builder setHasAutoCorrection(final boolean hasAutoCorrection) {
mHasAutoCorrection = hasAutoCorrection;
return this;
}
// Should get rid of the first one (what the user typed previously) from suggestions
// and replace it with what the user currently typed.
public static ArrayList<SuggestedWordInfo> getTypedWordAndPreviousSuggestions(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment