diff options
author | Matthew Wong <wongma7@outlook.com> | 2016-07-02 13:36:27 -0400 |
---|---|---|
committer | Matthew Wong <wongma7@outlook.com> | 2016-07-02 13:36:27 -0400 |
commit | 7826dce5269cf0da753acdd301c125252cd8f0c0 (patch) | |
tree | 778ef5cb11a0cdbc0f1fe7b83e372e4fd39c067c /app/src | |
parent | 5a509af320620453b76d6a3b1d82dde41d676258 (diff) |
Only clear the clipboard if we automatically copied the password to it
Diffstat (limited to 'app/src')
-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) { |