aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-10-09 21:26:12 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-09 21:26:12 -0700
commite1e95fd2e48ad639d9df38be565abd9c71007c19 (patch)
tree3dcf27b94617fab3d6307ce37b2b77d5d8ae6183 /java/src
parent05aaedd0240e5982c15f40a18c76b4fd0f8a68eb (diff)
parentea3a2f28ab602d1e2b7d1540c1863638832ec83a (diff)
downloadlatinime-e1e95fd2e48ad639d9df38be565abd9c71007c19.tar.gz
latinime-e1e95fd2e48ad639d9df38be565abd9c71007c19.tar.xz
latinime-e1e95fd2e48ad639d9df38be565abd9c71007c19.zip
am ea3a2f28: am 0675d374: am 86f77114: Merge "Don\'t auto-correct to non-whitelist shortcuts"
* commit 'ea3a2f28ab602d1e2b7d1540c1863638832ec83a': Don't auto-correct to non-whitelist shortcuts
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 9fd1f53a2..c270d47d0 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -286,14 +286,16 @@ public final class Suggest {
// the word *would* have been auto-corrected.
if (!isCorrectionEnabled || !allowsToBeAutoCorrected || !wordComposer.isComposingWord()
|| suggestionsSet.isEmpty() || wordComposer.hasDigits()
- || wordComposer.isMostlyCaps() || wordComposer.isResumed()
- || !hasMainDictionary()) {
+ || wordComposer.isMostlyCaps() || wordComposer.isResumed() || !hasMainDictionary()
+ || SuggestedWordInfo.KIND_SHORTCUT == suggestionsSet.first().mKind) {
// If we don't have a main dictionary, we never want to auto-correct. The reason for
// this is, the user may have a contact whose name happens to match a valid word in
// their language, and it will unexpectedly auto-correct. For example, if the user
// types in English with no dictionary and has a "Will" in their contact list, "will"
// would always auto-correct to "Will" which is unwanted. Hence, no main dict => no
// auto-correct.
+ // Also, shortcuts should never auto-correct unless they are whitelist entries.
+ // TODO: we may want to have shortcut-only entries auto-correct in the future.
hasAutoCorrection = false;
} else {
hasAutoCorrection = AutoCorrectionUtils.suggestionExceedsAutoCorrectionThreshold(