aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorMatthew Wong <wongma7@outlook.com>2015-08-26 03:25:55 -0400
committerMatthew Wong <wongma7@outlook.com>2015-08-26 03:25:55 -0400
commit540349542bac3bcce15a0d9fed74caff76807130 (patch)
treeff2fd64f1d080ed69bfbfcc82e6778e72a2d8020 /app/src/main
parent6665c0b2e98c6599d8c66854e97ceb08958dab56 (diff)
Revert asynctask cancelling; allow parallel asynctasks
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java14
1 files changed, 3 insertions, 11 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 fa46fb3c..67311774 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
@@ -56,7 +56,6 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
SharedPreferences settings;
private Activity activity;
ClipboardManager clipboard;
- AsyncTask delayShowTask;
private boolean registered;
@@ -141,10 +140,6 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
break;
case R.id.edit_password:
editPassword();
- if (delayShowTask != null) {
- delayShowTask.cancel(true);
- delayShowTask = null;
- }
}
return super.onOptionsItemSelected(item);
}
@@ -285,9 +280,6 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
if (showPassword) {
publishProgress(current);
}
- if (isCancelled()) {
- return false;
- }
}
return true;
}
@@ -302,8 +294,9 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
clipboard.setPrimaryClip(clip);
}
}
- if (showPassword) {
+ if (showPassword && findViewById(R.id.crypto_password_show) != null) {
//clear password
+ // if decrypt layout changed to encrypt layout via edit button, no need for this
((TextView) findViewById(R.id.crypto_password_show)).setText("");
((TextView) findViewById(R.id.crypto_extra_show)).setText("");
findViewById(R.id.crypto_extra_show_layout).setVisibility(View.INVISIBLE);
@@ -313,7 +306,6 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
}
}
-
@Override
protected void onProgressUpdate(Integer... values) {
if (showPassword) {
@@ -401,7 +393,7 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
copyToClipBoard();
}
- delayShowTask = new DelayShow().execute();
+ new DelayShow().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
if (!showPassword) {
activity.setResult(RESULT_CANCELED);
activity.finish();