aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/DictionaryFactory.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-04-27 17:10:18 +0900
committerJean Chalard <jchalard@google.com>2011-04-27 17:10:18 +0900
commit19bfef6cb0714a46a276abe45329e4abb661f76e (patch)
treea0798d7a194417ee65cd82959b88ce125f8f36eb /java/src/com/android/inputmethod/latin/DictionaryFactory.java
parent4250eb27f54f8fedc388fe4825b0646a88778744 (diff)
downloadlatinime-19bfef6cb0714a46a276abe45329e4abb661f76e.tar.gz
latinime-19bfef6cb0714a46a276abe45329e4abb661f76e.tar.xz
latinime-19bfef6cb0714a46a276abe45329e4abb661f76e.zip
Use the new Utils.setSystemLocale method in the new code.
The change list that introduced this code was created at the same time as the one that introduced the Utils.setSystemLocale method and didn't use it yet. Fix this. Change-Id: Ifdd2ad9f7dbb7f300bc255bc2e035ae893a9d410
Diffstat (limited to 'java/src/com/android/inputmethod/latin/DictionaryFactory.java')
-rw-r--r--java/src/com/android/inputmethod/latin/DictionaryFactory.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/DictionaryFactory.java b/java/src/com/android/inputmethod/latin/DictionaryFactory.java
index cd42d7c3d..2dbd582f3 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryFactory.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryFactory.java
@@ -124,13 +124,10 @@ public class DictionaryFactory {
*/
public static boolean isDictionaryAvailable(Context context, Locale locale) {
final Resources res = context.getResources();
- final Configuration conf = res.getConfiguration();
- final Locale saveLocale = conf.locale;
- conf.locale = locale;
- res.updateConfiguration(conf, res.getDisplayMetrics());
+ final Locale saveLocale = Utils.setSystemLocale(res, locale);
final int resourceId = Utils.getMainDictionaryResourceId(res);
- final AssetFileDescriptor afd = context.getResources().openRawResourceFd(resourceId);
+ final AssetFileDescriptor afd = res.openRawResourceFd(resourceId);
final boolean hasDictionary = isFullDictionary(afd);
try {
if (null != afd) afd.close();
@@ -138,8 +135,7 @@ public class DictionaryFactory {
/* Um, what can we do here exactly? */
}
- conf.locale = saveLocale;
- res.updateConfiguration(conf, res.getDisplayMetrics());
+ Utils.setSystemLocale(res, saveLocale);
return hasDictionary;
}