onBoot perm should default to true

This commit is contained in:
Nathan Freitas 2014-07-19 20:39:42 -04:00
parent 8f1b345827
commit 6ed7ab0d6d
1 changed files with 9 additions and 1 deletions

View File

@ -7,19 +7,27 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
public class OnBootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
//Log.i(TorService.TAG,"got boot receiver event");
if (intent.getAction() != null
&& Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()))
{
//Log.i(TorService.TAG,"boot is completed");
SharedPreferences prefs = TorServiceUtils.getSharedPrefs(context.getApplicationContext());
boolean startOnBoot = prefs.getBoolean("pref_start_boot",false);
boolean startOnBoot = prefs.getBoolean("pref_start_boot",true);
// Log.i(TorService.TAG,"start on boot: " + startOnBoot);
if (startOnBoot)
{