diff options
author | 2014-04-28 14:14:56 +0000 | |
---|---|---|
committer | 2014-04-28 14:14:56 +0000 | |
commit | 3fbbeea65047237f6bbd914088c27a3fe0f3c310 (patch) | |
tree | a78eccbc57a52d7ff775bd526df646627937f4a0 /java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java | |
parent | af71eed4e99464639c1c186d5568038127798c52 (diff) | |
parent | 4426cbc59ed026c07da2d1a91e8057562c304d58 (diff) | |
download | latinime-3fbbeea65047237f6bbd914088c27a3fe0f3c310.tar.gz latinime-3fbbeea65047237f6bbd914088c27a3fe0f3c310.tar.xz latinime-3fbbeea65047237f6bbd914088c27a3fe0f3c310.zip |
am 4426cbc5: Fix: contacts/user dicts are too frequently regenerated.
* commit '4426cbc59ed026c07da2d1a91e8057562c304d58':
Fix: contacts/user dicts are too frequently regenerated.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java index 08f3c63a3..550db4a6c 100644 --- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java @@ -511,12 +511,12 @@ abstract public class ExpandableBinaryDictionary extends Dictionary { */ private final void asyncReloadDictionary() { if (mIsReloading.compareAndSet(false, true)) { - mNeedsToReload = false; asyncExecuteTaskWithWriteLock(new Runnable() { @Override public void run() { try { - if (!mDictFile.exists() || haveContentsChanged()) { + // TODO: Quit checking contents in ExpandableBinaryDictionary. + if (!mDictFile.exists() || (mNeedsToReload && haveContentsChanged())) { // If the dictionary file does not exist or contents have been updated, // generate a new one. createNewDictionaryLocked(); @@ -524,6 +524,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary { // Otherwise, load the existing dictionary. loadBinaryDictionaryLocked(); } + mNeedsToReload = false; if (mBinaryDictionary != null && !(isValidDictionaryLocked() // TODO: remove the check below && matchesExpectedBinaryDictFormatVersionForThisType( |