Only clear the clipboard if we automatically copied the password to it

This commit is contained in:
Matthew Wong 2016-07-02 13:36:27 -04:00
parent 5a509af320
commit 7826dce526

View file

@ -312,12 +312,15 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
@Override @Override
protected void onPostExecute(Boolean b) { protected void onPostExecute(Boolean b) {
ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", "MyPasswordIsDaBest!"); // only clear the clipboard if we automatically copied the password to it
clipboard.setPrimaryClip(clip); if (settings.getBoolean("copy_on_decrypt", true)) {
if (settings.getBoolean("clear_clipboard_20x", false)) { ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", "MyPasswordIsDaBest!");
for (int i = 0; i < 19; i++) { clipboard.setPrimaryClip(clip);
clip = ClipData.newPlainText(String.valueOf(i), String.valueOf(i)); if (settings.getBoolean("clear_clipboard_20x", false)) {
clipboard.setPrimaryClip(clip); 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) { if (showPassword && findViewById(R.id.crypto_password_show) != null) {