aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services/EventReceiver.java
diff options
context:
space:
mode:
authorSam Whited <sam@samwhited.com>2014-10-22 15:44:55 -0400
committerSam Whited <sam@samwhited.com>2014-10-22 15:47:11 -0400
commit281ce3105fad5f012471cf3e5062a4032dfbc7a6 (patch)
tree63f9e37c2104609a9ace4724b5e10c3539a7feb4 /src/main/java/eu/siacs/conversations/services/EventReceiver.java
parent07b47172a08c01c248c6f69bae48d9e60695a14b (diff)
Make conversations the root project
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/EventReceiver.java')
-rw-r--r--src/main/java/eu/siacs/conversations/services/EventReceiver.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/EventReceiver.java b/src/main/java/eu/siacs/conversations/services/EventReceiver.java
new file mode 100644
index 000000000..dfbe9db76
--- /dev/null
+++ b/src/main/java/eu/siacs/conversations/services/EventReceiver.java
@@ -0,0 +1,24 @@
+package eu.siacs.conversations.services;
+
+import eu.siacs.conversations.persistance.DatabaseBackend;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+
+public class EventReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Intent mIntentForService = new Intent(context,
+ XmppConnectionService.class);
+ if (intent.getAction() != null) {
+ mIntentForService.setAction(intent.getAction());
+ } else {
+ mIntentForService.setAction("other");
+ }
+ if (intent.getAction().equals("ui")
+ || DatabaseBackend.getInstance(context).hasEnabledAccounts()) {
+ context.startService(mIntentForService);
+ }
+ }
+
+}