Remove a useless escape
Change-Id: I1ef0685cc9888c9cef9f60015d32b66dde75ef9b
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 6230b42..3d6d5a7 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -454,7 +454,8 @@
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 @@
// 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
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index 9549c79..2018bca 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -208,10 +208,6 @@
return mWords.get(pos);
}
- public boolean isTypedWordValid() {
- return mTypedWordValid;
- }
-
public boolean allowsToBeAutoCorrected() {
return mAllowsToBeAutoCorrected;
}