Merge pull request #1827 from k9mail/encapsulated-sigkey-intent

Use PendingIntent from encapsulated result if available for showing key info
This commit is contained in:
cketti 2016-12-05 17:49:21 +01:00 committed by GitHub
commit 00e63fc8f1
2 changed files with 12 additions and 1 deletions

View file

@ -101,6 +101,17 @@ public final class CryptoResultAnnotation {
return openPgpSignatureResult;
}
@Nullable
public PendingIntent getOpenPgpSigningKeyIntentIfAny() {
if (hasSignatureResult()) {
return getOpenPgpPendingIntent();
}
if (encapsulatedResult != null && encapsulatedResult.hasSignatureResult()) {
return encapsulatedResult.getOpenPgpPendingIntent();
}
return null;
}
@Nullable
public PendingIntent getOpenPgpPendingIntent() {
return openPgpPendingIntent;

View file

@ -188,7 +188,7 @@ public class MessageCryptoPresenter implements OnCryptoClickListener {
public void onClickShowCryptoKey() {
try {
PendingIntent pendingIntent = cryptoResultAnnotation.getOpenPgpPendingIntent();
PendingIntent pendingIntent = cryptoResultAnnotation.getOpenPgpSigningKeyIntentIfAny();
if (pendingIntent != null) {
messageCryptoMvpView.startPendingIntentForCryptoPresenter(
pendingIntent.getIntentSender(), null, null, 0, 0, 0);