diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index f46dd094ca..2ebaa6e6fb 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -297,8 +297,6 @@ public class FragmentCompose extends FragmentBase { private long[] pgpKeyIds; private long pgpSignKeyId; - private static final long MAX_PGP_BIND_DELAY = 250; // milliseconds - private static final int REDUCED_IMAGE_SIZE = 1440; // pixels private static final int REDUCED_IMAGE_QUALITY = 90; // percent // http://regex.info/blog/lightroom-goodies/jpeg-quality @@ -4610,7 +4608,7 @@ public class FragmentCompose extends FragmentBase { EntityMessage.PGP_SIGNENCRYPT.equals(ref.ui_encrypt)) { if (Helper.isOpenKeychainInstalled(context) && selected.sign_key != null && - PgpHelper.hasPgpKey(context, recipients, MAX_PGP_BIND_DELAY)) + PgpHelper.hasPgpKey(context, recipients)) data.draft.ui_encrypt = ref.ui_encrypt; } else if (EntityMessage.SMIME_SIGNONLY.equals(ref.ui_encrypt) || EntityMessage.SMIME_SIGNENCRYPT.equals(ref.ui_encrypt)) { @@ -5846,7 +5844,7 @@ public class FragmentCompose extends FragmentBase { EntityMessage.DSN_NONE.equals(draft.dsn)) && (draft.ui_encrypt == null || EntityMessage.ENCRYPT_NONE.equals(draft.ui_encrypt))) { - args.putBoolean("remind_pgp", PgpHelper.hasPgpKey(context, recipients, MAX_PGP_BIND_DELAY)); + args.putBoolean("remind_pgp", PgpHelper.hasPgpKey(context, recipients)); args.putBoolean("remind_smime", SmimeHelper.hasSmimeKey(context, recipients)); } diff --git a/app/src/main/java/eu/faircode/email/PgpHelper.java b/app/src/main/java/eu/faircode/email/PgpHelper.java index 66c50e1528..7232bc0320 100644 --- a/app/src/main/java/eu/faircode/email/PgpHelper.java +++ b/app/src/main/java/eu/faircode/email/PgpHelper.java @@ -43,6 +43,7 @@ import javax.mail.internet.InternetAddress; public class PgpHelper { private static final long CONNECT_TIMEOUT = 5000L; + private static final long KEY_TIMEOUT = 250L; static Intent execute(Context context, Intent data, InputStream is, OutputStream os) { return execute(context, data, is, os, CONNECT_TIMEOUT); @@ -68,10 +69,10 @@ public class PgpHelper { } static boolean hasPgpKey(Context context, List
recipients) { - return hasPgpKey(context, recipients, CONNECT_TIMEOUT); + return hasPgpKey(context, recipients, KEY_TIMEOUT); // milliseconds } - static boolean hasPgpKey(Context context, List
recipients, long timeout) { + private static boolean hasPgpKey(Context context, List
recipients, long timeout) { if (recipients == null || recipients.size() == 0) return false;