mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
Fix saving of allowed keys
This commit is contained in:
parent
15e7e5f7c6
commit
464f7c6718
@ -1310,7 +1310,6 @@ public class ProviderHelper {
|
|||||||
|
|
||||||
progress.setProgress(100, 100);
|
progress.setProgress(100, 100);
|
||||||
log.add(LogType.MSG_CON_SUCCESS, indent);
|
log.add(LogType.MSG_CON_SUCCESS, indent);
|
||||||
indent -= 1;
|
|
||||||
|
|
||||||
return new ConsolidateResult(ConsolidateResult.RESULT_OK, log);
|
return new ConsolidateResult(ConsolidateResult.RESULT_OK, log);
|
||||||
|
|
||||||
@ -1528,20 +1527,15 @@ public class ProviderHelper {
|
|||||||
|
|
||||||
public void saveAllowedKeyIdsForApp(Uri uri, Set<Long> allowedKeyIds)
|
public void saveAllowedKeyIdsForApp(Uri uri, Set<Long> allowedKeyIds)
|
||||||
throws RemoteException, OperationApplicationException {
|
throws RemoteException, OperationApplicationException {
|
||||||
ArrayList<ContentProviderOperation> ops = new ArrayList<>();
|
// wipe whole table of allowed keys for this account
|
||||||
|
mContentResolver.delete(uri, null, null);
|
||||||
// clear table
|
|
||||||
ops.add(ContentProviderOperation.newDelete(uri)
|
|
||||||
.build());
|
|
||||||
|
|
||||||
// re-insert allowed key ids
|
// re-insert allowed key ids
|
||||||
for (Long keyId : allowedKeyIds) {
|
for (Long keyId : allowedKeyIds) {
|
||||||
ops.add(ContentProviderOperation.newInsert(uri)
|
ContentValues values = new ContentValues();
|
||||||
.withValue(ApiAllowedKeys.KEY_ID, keyId)
|
values.put(ApiAllowedKeys.KEY_ID, keyId);
|
||||||
.build());
|
mContentResolver.insert(uri, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
getContentResolver().applyBatch(KeychainContract.CONTENT_AUTHORITY, ops);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getAllFingerprints(Uri uri) {
|
public Set<String> getAllFingerprints(Uri uri) {
|
||||||
|
Loading…
Reference in New Issue
Block a user