OLD | NEW |
(Empty) | |
| 1 package org.adblockplus.android; |
| 2 |
| 3 import android.content.BroadcastReceiver; |
| 4 import android.content.Context; |
| 5 import android.content.Intent; |
| 6 import android.content.SharedPreferences; |
| 7 import android.preference.PreferenceManager; |
| 8 |
| 9 public class BootBroadcastReceiver extends BroadcastReceiver |
| 10 { |
| 11 @Override |
| 12 public void onReceive(Context context, Intent intent) |
| 13 { |
| 14 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(cont
ext); |
| 15 boolean enabled = prefs.getBoolean(context.getString(R.string.pref_enabled),
false); |
| 16 boolean startAtBoot = prefs.getBoolean(context.getString(R.string.pref_start
atboot), context.getResources().getBoolean(R.bool.def_startatboot)); |
| 17 if (enabled && startAtBoot) |
| 18 context.startService(new Intent(context, ProxyService.class)); |
| 19 } |
| 20 } |
OLD | NEW |