diff --git a/k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSettings.java b/k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSettings.java index 968183156..61ad8d398 100644 --- a/k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSettings.java +++ b/k9mail/src/main/java/com/fsck/k9/activity/setup/AccountSettings.java @@ -790,6 +790,7 @@ public class AccountSettings extends K9PreferenceActivity { pgpCryptoKey.setValue(account.getOpenPgpKey()); pgpCryptoKey.setOpenPgpProvider(openPgpApiManager, pgpProvider); pgpCryptoKey.setDefaultUserId(OpenPgpApiHelper.buildUserId(account.getIdentity(0))); + pgpCryptoKey.setShowAutocryptHint(true); pgpCryptoKey.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { public boolean onPreferenceChange(Preference preference, Object newValue) { long value = (Long) newValue; diff --git a/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java b/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java index a32ae3dfd..29b958de9 100644 --- a/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java +++ b/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpApi.java @@ -267,6 +267,7 @@ public class OpenPgpApi { // GET_SIGN_KEY_ID public static final String EXTRA_USER_ID = "user_id"; public static final String EXTRA_PRESELECT_KEY_ID = "preselect_key_id"; + public static final String EXTRA_SHOW_AUTOCRYPT_HINT = "show_autocrypt_hint"; // GET_KEY public static final String EXTRA_KEY_ID = "key_id"; diff --git a/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java b/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java index 82d2a1cfa..106f1b076 100644 --- a/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java +++ b/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java @@ -41,6 +41,7 @@ import timber.log.Timber; public class OpenPgpKeyPreference extends Preference implements OpenPgpApiManagerCallback { private long keyId; private String defaultUserId; + private boolean showAutocryptHint; private OpenPgpApiManager openPgpApiManager; private Intent cachedActivityResultData; @@ -69,6 +70,10 @@ public class OpenPgpKeyPreference extends Preference implements OpenPgpApiManage defaultUserId = userId; } + public void setShowAutocryptHint(boolean showAutocryptHint) { + this.showAutocryptHint = showAutocryptHint; + } + @Override protected void onClick() { switch (openPgpApiManager.getOpenPgpProviderState()) { @@ -122,6 +127,7 @@ public class OpenPgpKeyPreference extends Preference implements OpenPgpApiManage data.setAction(OpenPgpApi.ACTION_GET_SIGN_KEY_ID); data.putExtra(OpenPgpApi.EXTRA_USER_ID, defaultUserId); data.putExtra(OpenPgpApi.EXTRA_PRESELECT_KEY_ID, keyId); + data.putExtra(OpenPgpApi.EXTRA_SHOW_AUTOCRYPT_HINT, showAutocryptHint); OpenPgpApi api = openPgpApiManager.getOpenPgpApi(); api.executeApiAsync(data, null, null, openPgpCallback); }