diff options
author | 2014-11-27 03:05:28 +0000 | |
---|---|---|
committer | 2014-11-27 03:05:28 +0000 | |
commit | 50b0e7cdba695d94763d4980821fd7896aaf417e (patch) | |
tree | 1ac083c0b0b83e80773047e05e77712a4e6e78ad /java/src/com/android/inputmethod/latin/utils | |
parent | 5de30cc2a481a15e6ed05b11294deb2f19fb6c11 (diff) | |
parent | 2ffcad113a19bb1c33a9d2cc796d3b3d7f2b8316 (diff) | |
download | latinime-50b0e7cdba695d94763d4980821fd7896aaf417e.tar.gz latinime-50b0e7cdba695d94763d4980821fd7896aaf417e.tar.xz latinime-50b0e7cdba695d94763d4980821fd7896aaf417e.zip |
am 2ffcad11: Merge "Remove unused code from DictionaryFactory"
* commit '2ffcad113a19bb1c33a9d2cc796d3b3d7f2b8316':
Remove unused code from DictionaryFactory
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils')
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java | 11 |
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 |