aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-11-21 17:58:50 +0900
committerTadashi G. Takaoka <takaoka@google.com>2014-11-21 17:58:50 +0900
commita414b81a6c69e89ce36c3756560062af84af4027 (patch)
tree1ab216ac3db11860c507656feafd6aaf960f873d /java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java
parent8a711f2a547a61b9f4f3ef3bdb79a66b618db58f (diff)
downloadlatinime-a414b81a6c69e89ce36c3756560062af84af4027.tar.gz
latinime-a414b81a6c69e89ce36c3756560062af84af4027.tar.xz
latinime-a414b81a6c69e89ce36c3756560062af84af4027.zip
Remove unused code from DictionaryFactory
Change-Id: I666308ada968ee7993235ad98b92f2ad522af122
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java')
-rw-r--r--java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java11
1 files changed, 11 insertions, 0 deletions
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
@@ -230,6 +230,17 @@ public class DictionaryInfoUtils {
}
/**
+ * 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
* @param locale dictionary locale