From ebf9bb3a6392cc5f2938c57e83bdb908c5b6e1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Fri, 20 Mar 2015 13:51:06 +0100 Subject: Fix API RESULT_TYPE --- .../java/org/sufficientlysecure/keychain/remote/OpenPgpService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java index 4707a2ad5..660556509 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java @@ -571,15 +571,14 @@ public class OpenPgpService extends RemoteService { } } else if (pgpResult.success()) { Intent result = new Intent(); - int resultType = OpenPgpApi.RESULT_TYPE_UNENCRYPTED_UNSIGNED; OpenPgpSignatureResult signatureResult = pgpResult.getSignatureResult(); + int resultType = OpenPgpApi.RESULT_TYPE_UNENCRYPTED_UNSIGNED; if (signatureResult != null) { resultType |= OpenPgpApi.RESULT_TYPE_SIGNED; if (!signatureResult.isSignatureOnly()) { resultType |= OpenPgpApi.RESULT_TYPE_ENCRYPTED; } - result.putExtra(OpenPgpApi.RESULT_TYPE, resultType); result.putExtra(OpenPgpApi.RESULT_SIGNATURE, signatureResult); @@ -599,7 +598,10 @@ public class OpenPgpService extends RemoteService { // If signature key is known, return PendingIntent to show key result.putExtra(OpenPgpApi.RESULT_INTENT, getShowKeyPendingIntent(signatureResult.getKeyId())); } + } else { + resultType |= OpenPgpApi.RESULT_TYPE_ENCRYPTED; } + result.putExtra(OpenPgpApi.RESULT_TYPE, resultType); if (data.getIntExtra(OpenPgpApi.EXTRA_API_VERSION, -1) >= 4) { OpenPgpMetadata metadata = pgpResult.getDecryptMetadata(); -- cgit v1.2.3