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