Merge "Use different user dict name for spell checker."

main
Keisuke Kuroyanagi 2014-04-28 08:12:17 +00:00 committed by Android (Google) Code Review
commit dff7153820
2 changed files with 8 additions and 2 deletions

View File

@ -86,7 +86,12 @@ public class UserBinaryDictionary extends ExpandableBinaryDictionary {
public UserBinaryDictionary(final Context context, final Locale locale, public UserBinaryDictionary(final Context context, final Locale locale,
final boolean alsoUseMoreRestrictiveLocales, final File dictFile) { 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 if (null == locale) throw new NullPointerException(); // Catch the error earlier
final String localeStr = locale.toString(); final String localeStr = locale.toString();
if (SubtypeLocaleUtils.NO_LANGUAGE.equals(localeStr)) { if (SubtypeLocaleUtils.NO_LANGUAGE.equals(localeStr)) {

View File

@ -27,6 +27,7 @@ import java.util.ArrayList;
import java.util.Locale; import java.util.Locale;
public final class SynchronouslyLoadedUserBinaryDictionary extends UserBinaryDictionary { public final class SynchronouslyLoadedUserBinaryDictionary extends UserBinaryDictionary {
private static final String NAME = "spellcheck_user";
private final Object mLock = new Object(); private final Object mLock = new Object();
public SynchronouslyLoadedUserBinaryDictionary(final Context context, final Locale locale) { 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, public SynchronouslyLoadedUserBinaryDictionary(final Context context, final Locale locale,
final boolean alsoUseMoreRestrictiveLocales) { final boolean alsoUseMoreRestrictiveLocales) {
super(context, locale, alsoUseMoreRestrictiveLocales, null /* dictFile */); super(context, locale, alsoUseMoreRestrictiveLocales, null /* dictFile */, NAME);
} }
@Override @Override