mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
PGP: Set correct encryption state in message crypto annotation via RESULT_TYPE
This commit is contained in:
parent
16f09611fe
commit
ffc5ba2cf3
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user