From 3a5de64110eab7ae0b6b1da86b5ce30d5b16bd7a Mon Sep 17 00:00:00 2001 From: Mohammadinamul Sheik Date: Wed, 15 Apr 2015 11:12:40 -0700 Subject: 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 --- java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java') 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(); } -- cgit v1.2.3-83-g751a