diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java index dc4d55e3..399564a1 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -312,12 +312,15 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne @Override protected void onPostExecute(Boolean b) { - ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", "MyPasswordIsDaBest!"); - clipboard.setPrimaryClip(clip); - if (settings.getBoolean("clear_clipboard_20x", false)) { - for (int i = 0; i < 19; i++) { - clip = ClipData.newPlainText(String.valueOf(i), String.valueOf(i)); - clipboard.setPrimaryClip(clip); + // only clear the clipboard if we automatically copied the password to it + if (settings.getBoolean("copy_on_decrypt", true)) { + ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", "MyPasswordIsDaBest!"); + clipboard.setPrimaryClip(clip); + if (settings.getBoolean("clear_clipboard_20x", false)) { + for (int i = 0; i < 19; i++) { + clip = ClipData.newPlainText(String.valueOf(i), String.valueOf(i)); + clipboard.setPrimaryClip(clip); + } } } if (showPassword && findViewById(R.id.crypto_password_show) != null) { |