aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorsatok <satok@google.com>2012-05-31 20:27:07 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-31 20:27:07 -0700
commite656025282c0da28ed80b2604949092dbc5fb72e (patch)
tree4780039283339b451230e2fb93c9b4e2fe2ea230 /java/src
parentd30cfee577228873902a16791cd8c3ad3fad4a4c (diff)
parent72cd84665c01494de36a78555a6bdf9c6cdf0662 (diff)
downloadlatinime-e656025282c0da28ed80b2604949092dbc5fb72e.tar.gz
latinime-e656025282c0da28ed80b2604949092dbc5fb72e.tar.xz
latinime-e656025282c0da28ed80b2604949092dbc5fb72e.zip
am 72cd8466: Merge "Fix NPE in user history bigram dictionary" into jb-dev
* commit '72cd84665c01494de36a78555a6bdf9c6cdf0662': Fix NPE in user history bigram dictionary
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 38549436b..695bf8dce 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -454,6 +454,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Has to be package-visible for unit tests
/* package */ void loadSettings() {
+ // Note that the calling sequence of onCreate() and onCurrentInputMethodSubtypeChanged()
+ // is not guaranteed. It may even be called at the same time on a different thread.
if (null == mPrefs) mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
final RunInLocale<SettingsValues> job = new RunInLocale<SettingsValues>() {
@Override
@@ -495,6 +497,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
resetContactsDictionary(oldContactsDictionary);
+ // Note that the calling sequence of onCreate() and onCurrentInputMethodSubtypeChanged()
+ // is not guaranteed. It may even be called at the same time on a different thread.
+ if (null == mPrefs) mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
mUserHistoryDictionary = new UserHistoryDictionary(
this, localeStr, Suggest.DIC_USER_HISTORY, mPrefs);
mSuggest.setUserHistoryDictionary(mUserHistoryDictionary);
@@ -624,6 +629,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void onCurrentInputMethodSubtypeChanged(InputMethodSubtype subtype) {
+ // Note that the calling sequence of onCreate() and onCurrentInputMethodSubtypeChanged()
+ // is not guaranteed. It may even be called at the same time on a different thread.
mSubtypeSwitcher.updateSubtype(subtype);
}