Skip to content
Snippets Groups Projects
Commit f102f6a3 authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "Give the orders to delete the source files to the dict pack"

parents 635f68e8 5774908b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment