aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/com/zeapo
diff options
context:
space:
mode:
authorMatthew Wong <mawong@redhat.com>2016-12-26 05:51:59 -0500
committerMatthew Wong <mawong@redhat.com>2016-12-26 05:51:59 -0500
commit5a7bedd7184964cc910f55f17185da9d57e679fb (patch)
treedd9299e7e5b66d1371e17c02b3a22e1aacabddcf /app/src/main/java/com/zeapo
parent57be6f5e14925bae9f8b0b01c9aebe9f4592e1f2 (diff)
Use 500ms delay between 20x clipboard clears
Diffstat (limited to 'app/src/main/java/com/zeapo')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java11
1 files changed, 9 insertions, 2 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 f137a2b8..6382f914 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
@@ -11,6 +11,7 @@ import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Bundle;
+import android.os.Handler;
import android.os.SystemClock;
import android.preference.PreferenceManager;
import android.support.v4.app.FragmentManager;
@@ -362,9 +363,15 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", "MyPasswordIsDaBest!");
clipboard.setPrimaryClip(clip);
if (settings.getBoolean("clear_clipboard_20x", false)) {
+ Handler handler = new Handler();
for (int i = 0; i < 19; i++) {
- clip = ClipData.newPlainText(String.valueOf(i), String.valueOf(i));
- clipboard.setPrimaryClip(clip);
+ final String count = String.valueOf(i);
+ handler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ clipboard.setPrimaryClip(ClipData.newPlainText(count, count));
+ }
+ }, i*500);
}
}
}