From ed95d79cc4c7f4646a388005f99a195b4794623b Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Fri, 17 Jan 2014 10:30:16 -0800 Subject: Make contacts dict and user dict version 4. Bug: 12515251 Change-Id: I0b332e03b9102957bffaea56d4de17b9ee3cef23 --- .../inputmethod/latin/ExpandableBinaryDictionary.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java') diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java index ecef20efc..8e1675b2a 100644 --- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java @@ -136,12 +136,8 @@ abstract public class ExpandableBinaryDictionary extends Dictionary { */ protected abstract boolean hasContentChanged(); - protected boolean matchesExpectedBinaryDictFormatVersionForThisType(final int formatVersion) { - // This class is using format 2 because it's used by the User and Contacts dictionary - // only, which right now use format 2 (dicts using format 4 use Decaying*, which overrides - // this method). - // TODO: Migrate these dicts to ver4 format, and remove this function. - return formatVersion == FormatSpec.VERSION2; + private boolean matchesExpectedBinaryDictFormatVersionForThisType(final int formatVersion) { + return formatVersion == FormatSpec.VERSION4; } public boolean isValidDictionary() { @@ -194,12 +190,12 @@ abstract public class ExpandableBinaryDictionary extends Dictionary { } } - private static AbstractDictionaryWriter getDictionaryWriter(final Context context, + private static AbstractDictionaryWriter getDictionaryWriter( final boolean isDynamicPersonalizationDictionary) { if (isDynamicPersonalizationDictionary) { return null; } else { - return new DictionaryWriter(context); + return new DictionaryWriter(); } } @@ -233,7 +229,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary { mBinaryDictionary = null; mDictNameDictionaryUpdateController = getDictionaryUpdateController(dictName); // Currently, only dynamic personalization dictionary is updatable. - mDictionaryWriter = getDictionaryWriter(context, isUpdatable); + mDictionaryWriter = getDictionaryWriter(isUpdatable); } protected static String getDictNameWithLocale(final String name, final Locale locale) { -- cgit v1.2.3-83-g751a