diff options
author | Jean Chalard <jchalard@google.com> | 2014-06-04 18:13:32 +0900 |
---|---|---|
committer | Jean Chalard <jchalard@google.com> | 2014-06-04 22:00:00 +0900 |
commit | 976d0ce7f1d658bffbb14bb83005cd5545d9fd81 (patch) | |
tree | ede74035b4ee74c3e99c170a1ea4dd372fa10f98 /src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java | |
parent | 820848a038e98e43d76a8758b1ddecebda35c654 (diff) | |
download | packages_apps_Settings-976d0ce7f1d658bffbb14bb83005cd5545d9fd81.zip packages_apps_Settings-976d0ce7f1d658bffbb14bb83005cd5545d9fd81.tar.gz packages_apps_Settings-976d0ce7f1d658bffbb14bb83005cd5545d9fd81.tar.bz2 |
Allow multiple shortcuts for a personal dictionary word
Bug: 13869301
Change-Id: I040613bdddc9f18875e29f3382418476262b00ce
Diffstat (limited to 'src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java')
-rw-r--r-- | src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java b/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java index d81703e..638818a 100644 --- a/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java +++ b/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java @@ -146,7 +146,9 @@ public class UserDictionaryAddWordContents { // should not insert, because either A. the word exists with no shortcut, in which // case the exact same thing we want to insert is already there, or B. the word // exists with at least one shortcut, in which case it has priority on our word. - if (hasWord(newWord, context)) return UserDictionaryAddWordActivity.CODE_ALREADY_PRESENT; + if (TextUtils.isEmpty(newShortcut) && hasWord(newWord, context)) { + return UserDictionaryAddWordActivity.CODE_ALREADY_PRESENT; + } // Disallow duplicates. If the same word with no shortcut is defined, remove it; if // the same word with the same shortcut is defined, remove it; but we don't mind if |