Skip to content
Snippets Groups Projects
Commit 8e4b3bbf authored by Jean Chalard's avatar Jean Chalard
Browse files

Don't assume a word has been added to the user dict

The user may now cancel or edit a word upon adding to the
user dictionary. We can no longer assume the word has been
added as is and for the current locale. We should just rely
on standard mechanisms that inform us of new insertions.

Bug: 6015347
Change-Id: I069b19c0c844ca29d6de4c4d162306f9413adea8
parent b98c25d9
No related branches found
No related tags found
No related merge requests found
......@@ -165,17 +165,12 @@ public class UserDictionary extends ExpandableDictionary {
// Safeguard against adding long words. Can cause stack overflow.
if (word.length() >= getMaxWordLength()) return;
super.addWord(word, frequency);
// TODO: Add an argument to the intent to specify the frequency.
Intent intent = new Intent(ACTION_USER_DICTIONARY_INSERT);
intent.putExtra(Words.WORD, word);
intent.putExtra(Words.LOCALE, mLocale);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(intent);
// In case the above does a synchronous callback of the change observer
setRequiresReload(false);
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment