aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-01-31 16:59:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-01-31 16:59:11 +0000
commit5ea4365f077f59341430e00ed34a5d74b7877931 (patch)
treea18cbe772ae91a84351f13f81244c2d9ce5161f2 /java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java
parent4920d370f2a9f14bcc14212738590c22bd3752d0 (diff)
parentaf4a7e8c4b2a41e9be48965133ab489cc9484764 (diff)
downloadlatinime-5ea4365f077f59341430e00ed34a5d74b7877931.tar.gz
latinime-5ea4365f077f59341430e00ed34a5d74b7877931.tar.xz
latinime-5ea4365f077f59341430e00ed34a5d74b7877931.zip
Merge "Create methods in LatinIME to make the current dict lists"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java')
-rw-r--r--java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java b/java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java
index d9e4bb63d..9f91639a2 100644
--- a/java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java
+++ b/java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java
@@ -39,7 +39,6 @@ import java.util.Locale;
public class ExternalDictionaryGetterForDebug {
private static final String SOURCE_FOLDER = Environment.getExternalStorageDirectory().getPath()
+ "/Download";
- private static final String DICTIONARY_LOCALE_ATTRIBUTE = "locale";
private static String[] findDictionariesInTheDownloadedFolder() {
final File[] files = new File(SOURCE_FOLDER).listFiles();
@@ -90,8 +89,7 @@ public class ExternalDictionaryGetterForDebug {
final File file = new File(SOURCE_FOLDER, fileName.toString());
final FileHeader header = DictionaryInfoUtils.getDictionaryFileHeaderOrNull(file);
final StringBuilder message = new StringBuilder();
- final String locale =
- header.mDictionaryOptions.mAttributes.get(DICTIONARY_LOCALE_ATTRIBUTE);
+ final String locale = header.getLocaleString();
for (String key : header.mDictionaryOptions.mAttributes.keySet()) {
message.append(key + " = " + header.mDictionaryOptions.mAttributes.get(key));
message.append("\n");
@@ -123,13 +121,11 @@ public class ExternalDictionaryGetterForDebug {
BufferedOutputStream outputStream = null;
File tempFile = null;
try {
- final String locale =
- header.mDictionaryOptions.mAttributes.get(DICTIONARY_LOCALE_ATTRIBUTE);
+ final String locale = header.getLocaleString();
// Create the id for a main dictionary for this locale
final String id = BinaryDictionaryGetter.MAIN_DICTIONARY_CATEGORY
+ BinaryDictionaryGetter.ID_CATEGORY_SEPARATOR + locale;
- final String finalFileName =
- DictionaryInfoUtils.getCacheFileName(id, locale, context);
+ final String finalFileName = DictionaryInfoUtils.getCacheFileName(id, locale, context);
final String tempFileName = BinaryDictionaryGetter.getTempFileName(id, context);
tempFile = new File(tempFileName);
tempFile.delete();