Loading java/src/com/android/inputmethod/latin/Suggest.java +4 −3 Original line number Diff line number Diff line Loading @@ -454,7 +454,8 @@ public class Suggest implements Dictionary.WordCallback { autoCorrectionAvailable &= !wordComposer.isMostlyCaps(); builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion( autoCorrectionAvailable); if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, this, mAutoCorrectionThreshold)) { if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, this, mAutoCorrectionThreshold, !allowsToBeAutoCorrected)) { builder.setShouldBlockAutoCorrectionBySafetyNet(); } return builder; Loading Loading @@ -609,10 +610,10 @@ public class Suggest implements Dictionary.WordCallback { // this safety net public static boolean shouldBlockAutoCorrectionBySafetyNet( final SuggestedWords.Builder suggestedWordsBuilder, final Suggest suggest, final double autoCorrectionThreshold) { final double autoCorrectionThreshold, final boolean isTypedWordValid) { // Safety net for auto correction. // Actually if we hit this safety net, it's actually a bug. if (suggestedWordsBuilder.size() <= 1 || suggestedWordsBuilder.isTypedWordValid()) { if (suggestedWordsBuilder.size() <= 1 || isTypedWordValid) { return false; } // If user selected aggressive auto correction mode, there is no need to use the safety Loading java/src/com/android/inputmethod/latin/SuggestedWords.java +0 −4 Original line number Diff line number Diff line Loading @@ -208,10 +208,6 @@ public class SuggestedWords { return mWords.get(pos); } public boolean isTypedWordValid() { return mTypedWordValid; } public boolean allowsToBeAutoCorrected() { return mAllowsToBeAutoCorrected; } Loading Loading
java/src/com/android/inputmethod/latin/Suggest.java +4 −3 Original line number Diff line number Diff line Loading @@ -454,7 +454,8 @@ public class Suggest implements Dictionary.WordCallback { autoCorrectionAvailable &= !wordComposer.isMostlyCaps(); builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion( autoCorrectionAvailable); if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, this, mAutoCorrectionThreshold)) { if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, this, mAutoCorrectionThreshold, !allowsToBeAutoCorrected)) { builder.setShouldBlockAutoCorrectionBySafetyNet(); } return builder; Loading Loading @@ -609,10 +610,10 @@ public class Suggest implements Dictionary.WordCallback { // this safety net public static boolean shouldBlockAutoCorrectionBySafetyNet( final SuggestedWords.Builder suggestedWordsBuilder, final Suggest suggest, final double autoCorrectionThreshold) { final double autoCorrectionThreshold, final boolean isTypedWordValid) { // Safety net for auto correction. // Actually if we hit this safety net, it's actually a bug. if (suggestedWordsBuilder.size() <= 1 || suggestedWordsBuilder.isTypedWordValid()) { if (suggestedWordsBuilder.size() <= 1 || isTypedWordValid) { return false; } // If user selected aggressive auto correction mode, there is no need to use the safety Loading
java/src/com/android/inputmethod/latin/SuggestedWords.java +0 −4 Original line number Diff line number Diff line Loading @@ -208,10 +208,6 @@ public class SuggestedWords { return mWords.get(pos); } public boolean isTypedWordValid() { return mTypedWordValid; } public boolean allowsToBeAutoCorrected() { return mAllowsToBeAutoCorrected; } Loading