am 9d4d61f9: Merge "Allow multiple shortcuts for a personal dictionary word"

* commit '9d4d61f9c1273cbe1761c5eccb18e6df9a7490bc':
  Allow multiple shortcuts for a personal dictionary word
main
Jean Chalard 2014-06-04 13:35:54 +00:00 committed by Android Git Automerger
commit 43e28b475a
1 changed files with 3 additions and 1 deletions

View File

@ -167,7 +167,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 CODE_ALREADY_PRESENT;
if (TextUtils.isEmpty(newShortcut) && hasWord(newWord, context)) {
return 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