Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/org/adblockplus/android/BootBroadcastReceiver.java

Issue 8493083: ABP/Android UI (Closed)
Patch Set: ABP/Android UI Created Oct. 12, 2012, 1:24 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/org/adblockplus/android/BootBroadcastReceiver.java
===================================================================
new file mode 100755
--- /dev/null
+++ b/src/org/adblockplus/android/BootBroadcastReceiver.java
@@ -0,0 +1,20 @@
+package org.adblockplus.android;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
+
+public class BootBroadcastReceiver extends BroadcastReceiver
+{
+ @Override
+ public void onReceive(Context context, Intent intent)
+ {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ boolean enabled = prefs.getBoolean(context.getString(R.string.pref_enabled), false);
+ boolean startAtBoot = prefs.getBoolean(context.getString(R.string.pref_startatboot), context.getResources().getBoolean(R.bool.def_startatboot));
+ if (enabled && startAtBoot)
+ context.startService(new Intent(context, ProxyService.class));
+ }
+}
« no previous file with comments | « src/org/adblockplus/android/AdvancedPreferences.java ('k') | src/org/adblockplus/android/ConfigurationActivity.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld