aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/XmppActivity.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-03 16:39:19 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-03 16:39:19 +0100
commit69af009c88c4ffa0ea3275c4b875a13e0ecdcddc (patch)
tree962db20530e3485340915d761cd00f291a1120cc /src/eu/siacs/conversations/ui/XmppActivity.java
parentc609eefefac5097c7c40a9f1b8741e9634da316f (diff)
avoid some null pointers when pgp api is not installed
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/ui/XmppActivity.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java
index 569563c1..6b1d1289 100644
--- a/src/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/eu/siacs/conversations/ui/XmppActivity.java
@@ -3,6 +3,8 @@ package eu.siacs.conversations.ui;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.services.XmppConnectionService.XmppConnectionBinder;
import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.AlertDialog.Builder;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -63,5 +65,18 @@ public abstract class XmppActivity extends Activity {
}
}
+ public boolean hasPgp() {
+ if (xmppConnectionService.getPgpEngine()!=null) {
+ return true;
+ } else {
+ Builder builder = new AlertDialog.Builder(getApplicationContext());
+ builder.setTitle("OpenKeychain not found");
+ builder.setIconAttribute(android.R.attr.alertDialogIcon);
+ builder.setMessage("Please make sure you have installed OpenKeychain");
+ builder.create().show();
+ return false;
+ }
+ }
+
abstract void onBackendConnected();
}