mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-02 15:25:39 +00:00
solves the issue where pwd store closes without having bound with openkeychain
This commit is contained in:
@@ -63,6 +63,7 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
|
|||||||
|
|
||||||
|
|
||||||
private ProgressDialog bindingDialog;
|
private ProgressDialog bindingDialog;
|
||||||
|
private boolean registered;
|
||||||
|
|
||||||
public static final int REQUEST_CODE_SIGN = 9910;
|
public static final int REQUEST_CODE_SIGN = 9910;
|
||||||
public static final int REQUEST_CODE_ENCRYPT = 9911;
|
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", "");
|
accountName = settings.getString("openpgp_account_name", "");
|
||||||
keyIDs = settings.getString("openpgp_key_ids", "");
|
keyIDs = settings.getString("openpgp_key_ids", "");
|
||||||
|
|
||||||
|
registered = false;
|
||||||
|
|
||||||
if (TextUtils.isEmpty(providerPackageName)) {
|
if (TextUtils.isEmpty(providerPackageName)) {
|
||||||
Toast.makeText(this, "No OpenPGP Provider selected!", Toast.LENGTH_LONG).show();
|
Toast.makeText(this, "No OpenPGP Provider selected!", Toast.LENGTH_LONG).show();
|
||||||
Intent intent = new Intent(this, UserPreference.class);
|
Intent intent = new Intent(this, UserPreference.class);
|
||||||
@@ -110,6 +113,8 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
|
|||||||
bindingDialog.setCancelable(false);
|
bindingDialog.setCancelable(false);
|
||||||
bindingDialog.show();
|
bindingDialog.show();
|
||||||
|
|
||||||
|
registered = true;
|
||||||
|
|
||||||
ActionBar actionBar = getActionBar();
|
ActionBar actionBar = getActionBar();
|
||||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
@@ -118,7 +123,7 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
|
|||||||
@Override
|
@Override
|
||||||
public void onStop(){
|
public void onStop(){
|
||||||
super.onStop();
|
super.onStop();
|
||||||
if (this.mServiceConnection.isBound())
|
if (this.registered && this.mServiceConnection.isBound())
|
||||||
try {
|
try {
|
||||||
this.mServiceConnection.unbindFromService();
|
this.mServiceConnection.unbindFromService();
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
|
Reference in New Issue
Block a user