aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 6230b4224..3d6d5a776 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -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;
@@ -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