2010-07-28 04:43:58 +00:00
|
|
|
package org.torproject.android;
|
|
|
|
|
2011-05-10 02:08:16 +00:00
|
|
|
import org.torproject.android.service.TorService;
|
|
|
|
|
2010-07-28 04:43:58 +00:00
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
|
|
|
|
public class OnBootReceiver extends BroadcastReceiver {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
|
|
|
|
2011-05-10 02:08:16 +00:00
|
|
|
if (intent.getAction() != null
|
|
|
|
&& intent.getAction().equals("android.intent.action.BOOT_COMPLETED"))
|
|
|
|
{
|
|
|
|
//Phase 1: Launch a service
|
|
|
|
Intent service = new Intent();
|
|
|
|
service.setAction("onboot");
|
|
|
|
service.setClass(context, TorService.class);
|
|
|
|
context.startService(service);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-07-28 04:43:58 +00:00
|
|
|
}
|
|
|
|
|
2011-04-15 16:39:22 +00:00
|
|
|
|
2010-07-28 04:43:58 +00:00
|
|
|
}
|
|
|
|
|