From 08adb09e149f920a63ecbc5c2f63d9cb7dbee0ab Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 13 Mar 2012 19:13:15 +0900 Subject: [PATCH] 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 --- .../android/inputmethod/latin/Suggest.java | 9 +++------ .../inputmethod/latin/SuggestedWords.java | 20 ------------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index a5c70eca9..3015d75ce 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -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; diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index 5d0fc20b2..a9699af52 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -79,7 +79,6 @@ public class SuggestedWords { private boolean mIsPunctuationSuggestions; private boolean mShouldBlockAutoCorrectionBySafetyNet; private boolean mAllowsToBeAutoCorrected; - private boolean mHasAutoCorrection; private List mSuggestedWordInfoList = new ArrayList(); @@ -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 suggestedWordInfoList) { - return setWords(suggestedWordInfoList); - } - public Builder setWords(List 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 getFromCharSequenceList( final List wordList) { final ArrayList result = new ArrayList(); @@ -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 getTypedWordAndPreviousSuggestions(