Skip to content
Snippets Groups Projects
Commit ca2fba71 authored by Ken Wakasa's avatar Ken Wakasa Committed by Android Git Automerger
Browse files

am 6ee1bd42: Merge "Keep addWordToDictionary from doing disk I/O on main thread" into gingerbread

Merge commit '6ee1bd42' into gingerbread-plus-aosp

* commit '6ee1bd42':
  Keep addWordToDictionary from doing disk I/O on main thread
parents bf03559f 6ee1bd42
No related branches found
No related tags found
No related merge requests found
...@@ -89,13 +89,19 @@ public class UserDictionary extends ExpandableDictionary { ...@@ -89,13 +89,19 @@ public class UserDictionary extends ExpandableDictionary {
super.addWord(word, frequency); super.addWord(word, frequency);
// Update the user dictionary provider // Update the user dictionary provider
ContentValues values = new ContentValues(5); final ContentValues values = new ContentValues(5);
values.put(Words.WORD, word); values.put(Words.WORD, word);
values.put(Words.FREQUENCY, frequency); values.put(Words.FREQUENCY, frequency);
values.put(Words.LOCALE, mLocale); values.put(Words.LOCALE, mLocale);
values.put(Words.APP_ID, 0); values.put(Words.APP_ID, 0);
getContext().getContentResolver().insert(Words.CONTENT_URI, values); final ContentResolver contentResolver = getContext().getContentResolver();
new Thread("addWord") {
public void run() {
contentResolver.insert(Words.CONTENT_URI, values);
}
}.start();
// In case the above does a synchronous callback of the change observer // In case the above does a synchronous callback of the change observer
setRequiresReload(false); setRequiresReload(false);
} }
......
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