From a414b81a6c69e89ce36c3756560062af84af4027 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 21 Nov 2014 17:58:50 +0900 Subject: Remove unused code from DictionaryFactory Change-Id: I666308ada968ee7993235ad98b92f2ad522af122 --- .../android/inputmethod/latin/utils/DictionaryInfoUtils.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java') diff --git a/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java b/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java index 81c3e3c61..71d724d74 100644 --- a/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java @@ -229,6 +229,17 @@ public class DictionaryInfoUtils { return BinaryDictionaryGetter.MAIN_DICTIONARY_CATEGORY.equals(idArray[0]); } + /** + * Find out whether a dictionary is available for this locale. + * @param context the context on which to check resources. + * @param locale the locale to check for. + * @return whether a (non-placeholder) dictionary is available or not. + */ + public static boolean isDictionaryAvailable(final Context context, final Locale locale) { + final Resources res = context.getResources(); + return 0 != getMainDictionaryResourceIdIfAvailableForLocale(res, locale); + } + /** * Helper method to return a dictionary res id for a locale, or 0 if none. * @param res resources for the app -- cgit v1.2.3-83-g751a