aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java
diff options
context:
space:
mode:
authorMohammadinamul Sheik <inamul@google.com>2015-04-15 11:12:40 -0700
committerMohammadinamul Sheik <inamul@google.com>2015-04-15 11:12:40 -0700
commit3a5de64110eab7ae0b6b1da86b5ce30d5b16bd7a (patch)
tree3d0aa0c2da8b81603a6a61932aef1db22ddf53ac /java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java
parentbf732e70013c6703adf83ec34b38ba7bd2d4a509 (diff)
downloadlatinime-3a5de64110eab7ae0b6b1da86b5ce30d5b16bd7a.tar.gz
latinime-3a5de64110eab7ae0b6b1da86b5ce30d5b16bd7a.tar.xz
latinime-3a5de64110eab7ae0b6b1da86b5ce30d5b16bd7a.zip
Do not re-download the unused dictionaries.
Does the following 1. Uses dictionaries from the files/ directory while populating the entries into the pendingUpdates table. So that a download happens only if the metadata.json says so. 2. Delete an unusable dictionaries from the files/ directory. Bug: 20142708 Change-Id: Ibd738793585c39735868e324b8ad682dff0eba34
Diffstat (limited to 'java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java')
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java b/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java
index e720f3cd0..e61547a9d 100644
--- a/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java
+++ b/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java
@@ -95,6 +95,8 @@ public final class UpdateHandler {
// Name of the category for the main dictionary
public static final String MAIN_DICTIONARY_CATEGORY = "main";
+ public static final String TEMP_DICT_FILE_SUB = "___";
+
// The id for the "dictionary available" notification.
static final int DICT_AVAILABLE_NOTIFICATION_ID = 1;
@@ -743,7 +745,7 @@ public final class UpdateHandler {
throws IOException {
DebugLogUtils.l("Entering openTempFileOutput");
final File dir = context.getFilesDir();
- final File f = File.createTempFile(locale + "___", DICT_FILE_SUFFIX, dir);
+ final File f = File.createTempFile(locale + TEMP_DICT_FILE_SUB, DICT_FILE_SUFFIX, dir);
DebugLogUtils.l("File name is", f.getName());
return f.getName();
}