summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
+ }
+ }
+ }
+}