summaryrefslogtreecommitdiff
path: root/src/se
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-01-21 21:43:50 +0100
committerParménides GV <parmegv@sdf.org>2014-04-21 17:36:59 +0200
commitf85ff9f79376ca56c62c17e3f9c5968113b44565 (patch)
tree291b7b012dddbb62b727af935323d00eeb4cb596 /src/se
parenta7d27b132c0d267092a7f2c9a3f0a4f5836691d4 (diff)
Dashboard appears on boot.
Now we should be starting EIP only if the user had it enabled before.
Diffstat (limited to 'src/se')
-rw-r--r--src/se/leap/bitmaskclient/OnBootReceiver.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/se/leap/bitmaskclient/OnBootReceiver.java b/src/se/leap/bitmaskclient/OnBootReceiver.java
new file mode 100644
index 00000000..6e8fc245
--- /dev/null
+++ b/src/se/leap/bitmaskclient/OnBootReceiver.java
@@ -0,0 +1,22 @@
+package se.leap.bitmaskclient;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.util.Log;
+
+
+public class OnBootReceiver extends BroadcastReceiver {
+
+ // Debug: am broadcast -a android.intent.action.BOOT_COMPLETED
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
+ if (!context.getSharedPreferences(Dashboard.SHARED_PREFERENCES, Context.MODE_PRIVATE).getString(Provider.KEY, "").isEmpty()) {
+ Intent dashboard_intent = new Intent(context, Dashboard.class);
+ dashboard_intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ context.startActivity(dashboard_intent);
+ }
+ }
+ }
+}