From 817cd9a0d531a33fcecc0a59e6c75212b1d2801d Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Mon, 28 Apr 2014 16:31:20 +0900 Subject: [PATCH] Use different user dict name for spell checker. Bug: 13630847 Change-Id: Icabd08c674dcf086250b9e594328a43286d1d203 --- .../android/inputmethod/latin/UserBinaryDictionary.java | 7 ++++++- .../SynchronouslyLoadedUserBinaryDictionary.java | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java index 8838e27c4..646d2ca97 100644 --- a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java @@ -86,7 +86,12 @@ public class UserBinaryDictionary extends ExpandableBinaryDictionary { public UserBinaryDictionary(final Context context, final Locale locale, final boolean alsoUseMoreRestrictiveLocales, final File dictFile) { - super(context, getDictName(NAME, locale, dictFile), locale, Dictionary.TYPE_USER, dictFile); + this(context, locale, alsoUseMoreRestrictiveLocales, dictFile, NAME); + } + + protected UserBinaryDictionary(final Context context, final Locale locale, + final boolean alsoUseMoreRestrictiveLocales, final File dictFile, final String name) { + super(context, getDictName(name, locale, dictFile), locale, Dictionary.TYPE_USER, dictFile); if (null == locale) throw new NullPointerException(); // Catch the error earlier final String localeStr = locale.toString(); if (SubtypeLocaleUtils.NO_LANGUAGE.equals(localeStr)) { diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedUserBinaryDictionary.java b/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedUserBinaryDictionary.java index b493f8c35..1a6dd5818 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedUserBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/SynchronouslyLoadedUserBinaryDictionary.java @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.Locale; public final class SynchronouslyLoadedUserBinaryDictionary extends UserBinaryDictionary { + private static final String NAME = "spellcheck_user"; private final Object mLock = new Object(); public SynchronouslyLoadedUserBinaryDictionary(final Context context, final Locale locale) { @@ -35,7 +36,7 @@ public final class SynchronouslyLoadedUserBinaryDictionary extends UserBinaryDic public SynchronouslyLoadedUserBinaryDictionary(final Context context, final Locale locale, final boolean alsoUseMoreRestrictiveLocales) { - super(context, locale, alsoUseMoreRestrictiveLocales, null /* dictFile */); + super(context, locale, alsoUseMoreRestrictiveLocales, null /* dictFile */, NAME); } @Override