1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 09:52:16 -05:00

PGP: Set correct encryption state in message crypto annotation via RESULT_TYPE

This commit is contained in:
Dominik Schürmann 2015-03-21 15:40:15 +01:00
parent 16f09611fe
commit ffc5ba2cf3

View File

@ -403,12 +403,18 @@ public class MessageCryptoHelper {
resultAnnotation.setOutputData(outputPart); resultAnnotation.setOutputData(outputPart);
// TODO if the data /was/ encrypted, we should set it here! int resultType = currentCryptoResult.getIntExtra(OpenPgpApi.RESULT_TYPE,
// this is not easy to determine for inline data though OpenPgpApi.RESULT_TYPE_UNENCRYPTED_UNSIGNED);
resultAnnotation.setWasEncrypted(false); if ((resultType & OpenPgpApi.RESULT_TYPE_ENCRYPTED) == OpenPgpApi.RESULT_TYPE_ENCRYPTED) {
resultAnnotation.setWasEncrypted(true);
OpenPgpSignatureResult signatureResult = currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE); } else {
resultAnnotation.setSignatureResult(signatureResult); resultAnnotation.setWasEncrypted(false);
}
if ((resultType & OpenPgpApi.RESULT_TYPE_SIGNED) == OpenPgpApi.RESULT_TYPE_SIGNED) {
OpenPgpSignatureResult signatureResult =
currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE);
resultAnnotation.setSignatureResult(signatureResult);
}
PendingIntent pendingIntent = currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_INTENT); PendingIntent pendingIntent = currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_INTENT);
resultAnnotation.setPendingIntent(pendingIntent); resultAnnotation.setPendingIntent(pendingIntent);