Errors on decryption were not handled #588
This commit is contained in:
parent
2bec5efefe
commit
5d2de3b193
2 changed files with 10 additions and 2 deletions
|
@ -140,7 +140,7 @@ public class OpenPgpHeaderView extends LinearLayout {
|
|||
if (error == null) {
|
||||
text = context.getString(R.string.openpgp_unknown_error);
|
||||
} else {
|
||||
text = context.getString(R.string.openpgp_error, error.getMessage());
|
||||
text = context.getString(R.string.openpgp_decryption_failed, error.getMessage());
|
||||
}
|
||||
resultEncryptionText.setText(text);
|
||||
}
|
||||
|
@ -160,6 +160,9 @@ public class OpenPgpHeaderView extends LinearLayout {
|
|||
|
||||
switch (cryptoAnnotation.getErrorType()) {
|
||||
case CRYPTO_API_RETURNED_ERROR:
|
||||
displayEncryptionError();
|
||||
dontDisplayVerification();
|
||||
break;
|
||||
case NONE: {
|
||||
displayVerificationResult();
|
||||
break;
|
||||
|
@ -171,6 +174,11 @@ public class OpenPgpHeaderView extends LinearLayout {
|
|||
}
|
||||
}
|
||||
}
|
||||
private void dontDisplayVerification(){
|
||||
hideSignatureLayout();
|
||||
resultSignatureText.setVisibility(View.GONE);
|
||||
resultSignatureIcon.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void displayIncompleteSignedPart() {
|
||||
setSignatureImageAndTextColor(CryptoState.UNAVAILABLE);
|
||||
|
|
|
@ -1123,7 +1123,7 @@ Please submit bug reports, contribute new features and ask questions at
|
|||
<string name="openpgp_successful_decryption_valid_signature_uncertified">Successful decryption and valid signature but uncertified</string>
|
||||
<string name="openpgp_successful_decryption_unknown_signature">Successful decryption but missing public key</string>
|
||||
<string name="openpgp_get_key">Lookup missing key</string>
|
||||
<string name="openpgp_error">OpenPGP Error: %s</string>
|
||||
<string name="openpgp_decryption_failed">Decryption failed: %s</string>
|
||||
<string name="openpgp_unknown_error">Unknown OpenPGP Error</string>
|
||||
<string name="openpgp_user_id">User Id</string>
|
||||
<string name="openpgp_canceled_by_user">Canceled by user</string>
|
||||
|
|
Loading…
Reference in a new issue