aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-04-25 22:27:47 +0900
committerJean Chalard <jchalard@google.com>2013-04-26 17:31:55 +0900
commite8ed5d88763ce495ba36e7f7b8b334d75f211a2a (patch)
tree3752924ae70e4b6e55977f93ce1067b565ec870a /java/src
parent9a98ef696826a73fe676cb12e9755c04d868b668 (diff)
downloadlatinime-e8ed5d88763ce495ba36e7f7b8b334d75f211a2a.tar.gz
latinime-e8ed5d88763ce495ba36e7f7b8b334d75f211a2a.tar.xz
latinime-e8ed5d88763ce495ba36e7f7b8b334d75f211a2a.zip
Delete obsolete dictionaries
Bug: 7980985 Change-Id: I4c9165e6102cb12fa1249074297e94013439ea3b
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/ActionBatch.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/ActionBatch.java b/java/src/com/android/inputmethod/dictionarypack/ActionBatch.java
index a9d799218..bf2230553 100644
--- a/java/src/com/android/inputmethod/dictionarypack/ActionBatch.java
+++ b/java/src/com/android/inputmethod/dictionarypack/ActionBatch.java
@@ -483,13 +483,14 @@ public final class ActionBatch {
if (MetadataDbHelper.STATUS_INSTALLED == status
|| MetadataDbHelper.STATUS_DISABLED == status
|| MetadataDbHelper.STATUS_DELETING == status) {
- // If it is installed or disabled, then we cannot remove the entry lest the user
- // lose the ability to delete the file or otherwise administrate it. We will thus
- // leave it as is, but remove the URI from the database since it is not supposed to
- // be accessible any more.
+ // If it is installed or disabled, we need to mark it as deleted so that LatinIME
+ // will remove it next time it enquires for dictionaries.
// If it is deleting and we don't have a new version, then we have to wait until
- // Android Keyboard actually has deleted it before we can remove its metadata.
+ // LatinIME actually has deleted it before we can remove its metadata.
+ // In both cases, remove the URI from the database since it is not supposed to
+ // be accessible any more.
values.put(MetadataDbHelper.REMOTE_FILENAME_COLUMN, "");
+ values.put(MetadataDbHelper.STATUS_COLUMN, MetadataDbHelper.STATUS_DELETING);
db.update(MetadataDbHelper.METADATA_TABLE_NAME, values,
MetadataDbHelper.WORDLISTID_COLUMN + " = ? AND "
+ MetadataDbHelper.VERSION_COLUMN + " = ?",