From c3b151957cd2130cbf781fd815a7f7322308f542 Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Thu, 1 May 2014 17:28:24 +0900 Subject: [PATCH] Move dict version check to proper place. Change-Id: I89a5b4fa93153081b4f7a9183619cbe7c9ea01fa --- .../latin/ExpandableBinaryDictionary.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java index cda429e6a..c825ca462 100644 --- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java @@ -528,17 +528,17 @@ abstract public class ExpandableBinaryDictionary extends Dictionary { } else if (mBinaryDictionary == null) { // Otherwise, load the existing dictionary. loadBinaryDictionaryLocked(); + if (mBinaryDictionary != null && !(isValidDictionaryLocked() + // TODO: remove the check below + && matchesExpectedBinaryDictFormatVersionForThisType( + mBinaryDictionary.getFormatVersion()))) { + // Binary dictionary or its format version is not valid. Regenerate + // the dictionary file. writeBinaryDictionary will remove the + // existing files if appropriate. + createNewDictionaryLocked(); + } } mNeedsToReload = false; - if (mBinaryDictionary != null && !(isValidDictionaryLocked() - // TODO: remove the check below - && matchesExpectedBinaryDictFormatVersionForThisType( - mBinaryDictionary.getFormatVersion()))) { - // Binary dictionary or its format version is not valid. Regenerate - // the dictionary file. writeBinaryDictionary will remove the - // existing files if appropriate. - createNewDictionaryLocked(); - } } finally { mIsReloading.set(false); }