aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-01-31 09:01:19 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-01-31 09:01:19 -0800
commit0d42b8cb8a21afef40933682e6bae7bf6e3eef42 (patch)
tree0ccf69b77a20e7280cb4f264cf7b8bc57e8f103e /java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java
parentca2b14c5e334d8b0c67fc8c88b2296f779e74595 (diff)
parent5ea4365f077f59341430e00ed34a5d74b7877931 (diff)
downloadlatinime-0d42b8cb8a21afef40933682e6bae7bf6e3eef42.tar.gz
latinime-0d42b8cb8a21afef40933682e6bae7bf6e3eef42.tar.xz
latinime-0d42b8cb8a21afef40933682e6bae7bf6e3eef42.zip
am 5ea4365f: Merge "Create methods in LatinIME to make the current dict lists"
# Via Android (Google) Code Review (1) and Jean Chalard (1) * commit '5ea4365f077f59341430e00ed34a5d74b7877931': 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();