diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-12 19:22:34 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-12 19:22:34 +0200 |
commit | b47412eb1e2b983f803e6227ea5d07fdead9fe5a (patch) | |
tree | 39e8f98f500f052396e3a34dcce358a96cf8a899 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java | |
parent | 93aefaca8ef4a7c47c5822a49e9144e037da0d9d (diff) | |
download | open-keychain-b47412eb1e2b983f803e6227ea5d07fdead9fe5a.tar.gz open-keychain-b47412eb1e2b983f803e6227ea5d07fdead9fe5a.tar.bz2 open-keychain-b47412eb1e2b983f803e6227ea5d07fdead9fe5a.zip |
CertifyOperation is not a Pgp- operation
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java index 1bbeaf936..0dcfa1721 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -29,8 +29,8 @@ import android.os.RemoteException; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.operations.CertifyOperation; import org.sufficientlysecure.keychain.operations.DeleteOperation; -import org.sufficientlysecure.keychain.operations.PgpCertifyOperation; import org.sufficientlysecure.keychain.operations.results.DeleteResult; import org.sufficientlysecure.keychain.pgp.exception.PgpKeyNotFoundException; import org.sufficientlysecure.keychain.provider.ProviderHelper.NotFoundException; @@ -250,42 +250,34 @@ public class KeychainIntentService extends IntentService implements Progressable Log.logDebugBundle(data, "EXTRA_DATA"); + ProviderHelper providerHelper = new ProviderHelper(this); + String action = intent.getAction(); // executeServiceMethod action from extra bundle if (ACTION_CERTIFY_KEYRING.equals(action)) { - try { - - /* Input */ - CertifyActionsParcel parcel = data.getParcelable(CERTIFY_PARCEL); - - /* Operation */ - String passphrase = PassphraseCacheService.getCachedPassphrase(this, - // certification is always with the master key id, so use that one - parcel.mMasterKeyId, parcel.mMasterKeyId); - if (passphrase == null) { - throw new PgpGeneralException("Unable to obtain passphrase"); - } - - ProviderHelper providerHelper = new ProviderHelper(this); - PgpCertifyOperation op = new PgpCertifyOperation(this, providerHelper, this, mActionCanceled); - CertifyResult result = op.certify(parcel, passphrase); + // Input + CertifyActionsParcel parcel = data.getParcelable(CERTIFY_PARCEL); - sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, result); + // Operation + CertifyOperation op = new CertifyOperation(this, providerHelper, this, mActionCanceled); + CertifyResult result = op.certify(parcel); - } catch (Exception e) { - sendErrorToHandler(e); - } + // Result + sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, result); } else if (ACTION_CONSOLIDATE.equals(action)) { + // Operation ConsolidateResult result; if (data.containsKey(CONSOLIDATE_RECOVERY) && data.getBoolean(CONSOLIDATE_RECOVERY)) { result = new ProviderHelper(this).consolidateDatabaseStep2(this); } else { result = new ProviderHelper(this).consolidateDatabaseStep1(this); } + + // Result sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, result); } else if (ACTION_DECRYPT_METADATA.equals(action)) { @@ -617,7 +609,6 @@ public class KeychainIntentService extends IntentService implements Progressable numEntries = it.getSize(); } - ProviderHelper providerHelper = new ProviderHelper(this); ImportExportOperation importExportOperation = new ImportExportOperation( this, providerHelper, this, mActionCanceled); ImportKeyResult result = importExportOperation.importKeyRings(entries, numEntries); @@ -733,7 +724,6 @@ public class KeychainIntentService extends IntentService implements Progressable /* Operation */ HkpKeyserver server = new HkpKeyserver(keyServer); - ProviderHelper providerHelper = new ProviderHelper(this); CanonicalizedPublicKeyRing keyring = providerHelper.getCanonicalizedPublicKeyRing(dataUri); ImportExportOperation importExportOperation = new ImportExportOperation(this, new ProviderHelper(this), this); |