set correct upload status for newly created keys
This commit is contained in:
@@ -82,13 +82,14 @@ public class EditKeyOperation extends BaseReadWriteOperation<SaveKeyringParcel>
|
||||
}
|
||||
|
||||
// Perform actual modification (or creation)
|
||||
boolean isNewKey = saveParcel.getMasterKeyId() == null;
|
||||
PgpEditKeyResult modifyResult;
|
||||
{
|
||||
PgpKeyOperation keyOperations =
|
||||
new PgpKeyOperation(new ProgressScaler(mProgressable, 10, 60, 100), mCancelled);
|
||||
|
||||
// If a key id is specified, fetch and edit
|
||||
if (saveParcel.getMasterKeyId() != null) {
|
||||
if (!isNewKey) {
|
||||
try {
|
||||
|
||||
log.add(LogType.MSG_ED_FETCHING, 1,
|
||||
@@ -165,6 +166,10 @@ public class EditKeyOperation extends BaseReadWriteOperation<SaveKeyringParcel>
|
||||
SaveKeyringResult saveResult = mKeyWritableRepository.saveSecretKeyRing(ring);
|
||||
log.add(saveResult, 1);
|
||||
|
||||
if (isNewKey) {
|
||||
mKeyWritableRepository.renewKeyLastUpdatedTime(ring.getMasterKeyId(), saveParcel.isShouldUpload());
|
||||
}
|
||||
|
||||
// If the save operation didn't succeed, exit here
|
||||
if (!saveResult.success()) {
|
||||
return new EditKeyResult(EditKeyResult.RESULT_ERROR, log, null);
|
||||
|
||||
Reference in New Issue
Block a user