Merge pull request #1011 from k9mail/fix-openpgp-decrypt-loop-864
Fix OpenPGP decrypt loop
This commit is contained in:
commit
733f7f63f1
1 changed files with 8 additions and 1 deletions
|
@ -63,6 +63,7 @@ public class MessageCryptoHelper {
|
|||
private Intent currentCryptoResult;
|
||||
|
||||
private MessageCryptoAnnotations messageAnnotations;
|
||||
private Intent userInteractionResultIntent;
|
||||
|
||||
|
||||
public MessageCryptoHelper(Activity activity, Account account, MessageCryptoCallback callback) {
|
||||
|
@ -163,7 +164,12 @@ public class MessageCryptoHelper {
|
|||
|
||||
private void decryptOrVerifyPart(CryptoPart cryptoPart) {
|
||||
currentCryptoPart = cryptoPart;
|
||||
decryptVerify(new Intent());
|
||||
Intent decryptIntent = userInteractionResultIntent;
|
||||
userInteractionResultIntent = null;
|
||||
if (decryptIntent == null) {
|
||||
decryptIntent = new Intent();
|
||||
}
|
||||
decryptVerify(decryptIntent);
|
||||
}
|
||||
|
||||
private void decryptVerify(Intent intent) {
|
||||
|
@ -419,6 +425,7 @@ public class MessageCryptoHelper {
|
|||
}
|
||||
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
userInteractionResultIntent = data;
|
||||
decryptOrVerifyNextPart();
|
||||
} else {
|
||||
onCryptoFailed(new OpenPgpError(OpenPgpError.CLIENT_SIDE_ERROR, context.getString(R.string.openpgp_canceled_by_user)));
|
||||
|
|
Loading…
Reference in a new issue