Skip to content
Snippets Groups Projects
Commit 4426cbc5 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Fix: contacts/user dicts are too frequently regenerated.

Change-Id: I6b04a58c543fda6df7a2c016b8b8a5300f137d73
parent f614de62
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......
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