am e8ed5d88: Delete obsolete dictionaries

* commit 'e8ed5d88763ce495ba36e7f7b8b334d75f211a2a':
  Delete obsolete dictionaries
This commit is contained in:
Jean Chalard 2013-04-26 01:42:46 -07:00 committed by Android Git Automerger
commit 55d80e4f0c

View file

@ -483,13 +483,14 @@ public final class ActionBatch {
if (MetadataDbHelper.STATUS_INSTALLED == status if (MetadataDbHelper.STATUS_INSTALLED == status
|| MetadataDbHelper.STATUS_DISABLED == status || MetadataDbHelper.STATUS_DISABLED == status
|| MetadataDbHelper.STATUS_DELETING == status) { || MetadataDbHelper.STATUS_DELETING == status) {
// If it is installed or disabled, then we cannot remove the entry lest the user // If it is installed or disabled, we need to mark it as deleted so that LatinIME
// lose the ability to delete the file or otherwise administrate it. We will thus // will remove it next time it enquires for dictionaries.
// leave it as is, but remove the URI from the database since it is not supposed to
// be accessible any more.
// If it is deleting and we don't have a new version, then we have to wait until // 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.REMOTE_FILENAME_COLUMN, "");
values.put(MetadataDbHelper.STATUS_COLUMN, MetadataDbHelper.STATUS_DELETING);
db.update(MetadataDbHelper.METADATA_TABLE_NAME, values, db.update(MetadataDbHelper.METADATA_TABLE_NAME, values,
MetadataDbHelper.WORDLISTID_COLUMN + " = ? AND " MetadataDbHelper.WORDLISTID_COLUMN + " = ? AND "
+ MetadataDbHelper.VERSION_COLUMN + " = ?", + MetadataDbHelper.VERSION_COLUMN + " = ?",