diff options
author | knuthy <knuthy@gmail.com> | 2014-09-22 22:34:34 +0200 |
---|---|---|
committer | knuthy <knuthy@gmail.com> | 2014-09-22 22:34:34 +0200 |
commit | c9b4a5bac45f347cff61d7c35557d44dbbb320d6 (patch) | |
tree | 38771ac14b1b43f71b7c120d71670e9465d07021 /app/src | |
parent | 83b893bc8ca7359925c4be048aa149c59fbdb4af (diff) |
solves the issue where pwd store closes without having bound with openkeychain
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java | 7 |
1 files changed, 6 insertions, 1 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 cc4e2a4a..3213fd2e 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -63,6 +63,7 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB private ProgressDialog bindingDialog; + private boolean registered; public static final int REQUEST_CODE_SIGN = 9910; public static final int REQUEST_CODE_ENCRYPT = 9911; @@ -90,6 +91,8 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB accountName = settings.getString("openpgp_account_name", ""); keyIDs = settings.getString("openpgp_key_ids", ""); + registered = false; + if (TextUtils.isEmpty(providerPackageName)) { Toast.makeText(this, "No OpenPGP Provider selected!", Toast.LENGTH_LONG).show(); Intent intent = new Intent(this, UserPreference.class); @@ -110,6 +113,8 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB bindingDialog.setCancelable(false); bindingDialog.show(); + registered = true; + ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); } @@ -118,7 +123,7 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB @Override public void onStop(){ super.onStop(); - if (this.mServiceConnection.isBound()) + if (this.registered && this.mServiceConnection.isBound()) try { this.mServiceConnection.unbindFromService(); } catch (Exception e){ |