diff options
author | 2012-05-31 20:29:43 -0700 | |
---|---|---|
committer | 2012-05-31 20:29:43 -0700 | |
commit | 083fb024d7a6cb5a18af3965ba5cc16b8f19822c (patch) | |
tree | 0d7d62888748f0cbeb7c1e46a91901af429ecea1 /java/src/com/android/inputmethod | |
parent | 6fd153e5542adea4af15f91bea8a9ae0bf093ebe (diff) | |
parent | e656025282c0da28ed80b2604949092dbc5fb72e (diff) | |
download | latinime-083fb024d7a6cb5a18af3965ba5cc16b8f19822c.tar.gz latinime-083fb024d7a6cb5a18af3965ba5cc16b8f19822c.tar.xz latinime-083fb024d7a6cb5a18af3965ba5cc16b8f19822c.zip |
am e6560252: am 72cd8466: Merge "Fix NPE in user history bigram dictionary" into jb-dev
* commit 'e656025282c0da28ed80b2604949092dbc5fb72e':
Fix NPE in user history bigram dictionary
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 7 |
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 bd9a0c1d4..8a5608a4a 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); } |