From 3cfb4a0cd6c91c7e6077d17b80089c4332d0fd99 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 3 May 2014 15:24:19 +0200 Subject: [PATCH] added restart button to openkeychain dialog --- res/values/strings.xml | 2 +- .../conversations/services/XmppConnectionService.java | 1 + src/eu/siacs/conversations/ui/XmppActivity.java | 9 +++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index f4b7d5fa1..fa41b7b81 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -80,7 +80,7 @@ Send unencrypted Decrpytion failed. Maybe you don’t have the proper private key. OpenKeychain - Conversations utilizes a third party called OpenKeychain to encrypt and decrypt messages and to mange your public keys.\n\nOpenKeychain is licensed under GPLv3 and available on F-Droid and Google Play.\n\nTo use openPGP please install the app and then restart Conversations. + Conversations utilizes a third party app called OpenKeychain to encrypt and decrypt messages and to mange your public keys.\n\nOpenKeychain is licensed under GPLv3 and available on F-Droid and Google Play.\n\n(Please restart Conversations afterwards.) Restart Install diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 157b8175c..70d5fc03a 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -619,6 +619,7 @@ public class XmppConnectionService extends Service { @Override public void onDestroy() { + Log.d(LOGTAG,"stopping service"); super.onDestroy(); for (Account account : accounts) { if (account.getXmppConnection() != null) { diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java index 1f9c678a1..70c4614d5 100644 --- a/src/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/eu/siacs/conversations/ui/XmppActivity.java @@ -95,8 +95,12 @@ public abstract class XmppActivity extends Activity { @Override public void onClick(DialogInterface dialog, int which) { - // TODO Auto-generated method stub - + if (xmppConnectionServiceBound) { + unbindService(mConnection); + xmppConnectionServiceBound = false; + } + stopService(new Intent(XmppActivity.this, XmppConnectionService.class)); + finish(); } }); builder.setPositiveButton(getString(R.string.install), new OnClickListener() { @@ -106,6 +110,7 @@ public abstract class XmppActivity extends Activity { Uri uri = Uri.parse("market://details?id=org.sufficientlysecure.keychain"); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); + finish(); } }); builder.create().show();