Only clear the clipboard if we automatically copied the password to it
This commit is contained in:
parent
5a509af320
commit
7826dce526
1 changed files with 9 additions and 6 deletions
|
@ -312,6 +312,8 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Boolean b) {
|
protected void onPostExecute(Boolean b) {
|
||||||
|
// 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!");
|
ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", "MyPasswordIsDaBest!");
|
||||||
clipboard.setPrimaryClip(clip);
|
clipboard.setPrimaryClip(clip);
|
||||||
if (settings.getBoolean("clear_clipboard_20x", false)) {
|
if (settings.getBoolean("clear_clipboard_20x", false)) {
|
||||||
|
@ -320,6 +322,7 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
|
||||||
clipboard.setPrimaryClip(clip);
|
clipboard.setPrimaryClip(clip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (showPassword && findViewById(R.id.crypto_password_show) != null) {
|
if (showPassword && findViewById(R.id.crypto_password_show) != null) {
|
||||||
// clear password; if decrypt changed to encrypt layout via edit button, no need
|
// clear password; if decrypt changed to encrypt layout via edit button, no need
|
||||||
((TextView) findViewById(R.id.crypto_password_show)).setText("");
|
((TextView) findViewById(R.id.crypto_password_show)).setText("");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue