fix content observer for keyserver status

This commit is contained in:
Vincent Breitmoser
2017-07-20 21:30:34 +02:00
parent 74fad371bb
commit 57b0e16ecc
2 changed files with 16 additions and 2 deletions

View File

@@ -780,12 +780,12 @@ public class KeychainProvider extends ContentProvider {
break;
}
case UPDATED_KEYS: {
keyId = values.getAsLong(UpdatedKeys.MASTER_KEY_ID);
try {
db.insertOrThrow(Tables.UPDATED_KEYS, null, values);
} catch (SQLiteConstraintException e) {
String masterKeyId = values.getAsString(UpdatedKeys.MASTER_KEY_ID);
db.update(Tables.UPDATED_KEYS, values,
UpdatedKeys.MASTER_KEY_ID + " = ?", new String[] { masterKeyId });
UpdatedKeys.MASTER_KEY_ID + " = ?", new String[] { Long.toString(keyId) });
}
rowUri = UpdatedKeys.CONTENT_URI;
break;