aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-08-10 18:57:01 +0900
committerJean Chalard <jchalard@google.com>2011-08-10 21:55:15 +0900
commit5774908bb30db63f912ae588caebf257251884c8 (patch)
tree8e69b235d229bb7a3a3d7b6f42613fb168ce8216 /java/src/com/android/inputmethod
parentd4c08d9be3540466c8253ee02fecf4b6035d8ee0 (diff)
downloadlatinime-5774908bb30db63f912ae588caebf257251884c8.tar.gz
latinime-5774908bb30db63f912ae588caebf257251884c8.tar.xz
latinime-5774908bb30db63f912ae588caebf257251884c8.zip
Give the orders to delete the source files to the dict pack
Bug: 5095140 Change-Id: I64552861768ca30073ffe0d631b2e0c44dad4aa9
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
index 2d50a6f46..f4ba0bcdc 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
@@ -168,13 +168,17 @@ public class BinaryDictionaryFileDumper {
final List<String> idList = getDictIdList(locale, context);
final List<AssetFileAddress> fileAddressList = new ArrayList<AssetFileAddress>();
for (String id : idList) {
- final Uri dictionaryPackUri = getProviderUri(id);
+ final Uri wordListUri = getProviderUri(id);
final AssetFileDescriptor afd =
- resolver.openAssetFileDescriptor(dictionaryPackUri, "r");
+ resolver.openAssetFileDescriptor(wordListUri, "r");
if (null == afd) continue;
final String fileName = copyFileTo(afd.createInputStream(),
getCacheFileName(id, locale, context));
afd.close();
+ if (0 >= resolver.delete(wordListUri, null, null)) {
+ // I'd rather not print the word list ID to the log here out of security concerns
+ Log.e(TAG, "Could not have the dictionary pack delete a word list");
+ }
fileAddressList.add(AssetFileAddress.makeFromFileName(fileName));
}
return fileAddressList;