package com.usai.apex;





import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;

public class BootBroadcastReceiver extends BroadcastReceiver
{

	@Override
	public void onReceive(Context context, Intent intent)
	{
        if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {  
//            // 启动完成  
//            Intent iAlarm = new Intent(context, Alarmreceiver.class);  
//            iAlarm.setAction("com.usai.apex.push");  
//            PendingIntent sender = PendingIntent.getBroadcast(context, 0,  
//            		iAlarm, 0);  
//            long firstime = SystemClock.elapsedRealtime();  
//            AlarmManager am = (AlarmManager) context  
//                    .getSystemService(Context.ALARM_SERVICE);  
//  
//            // 10秒一个周期，不停的发送广播  
//            am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstime,  
//                    30 * 1000, sender);  
//			Intent intentservice = new Intent();
//			intentservice.setClass(context, ApexPushService.class);
//			if (intent.getExtras() != null)
//				intentservice.putExtras(intent.getExtras());
//			intentservice.setAction(intent.getAction());
//			context.startService(intentservice);
        	ApexTrackingApplication.startalarm("boot completed");
        } 
//		else if (intent.getAction().equals(
//				ConnectivityManager.CONNECTIVITY_ACTION))
//		{
//			
//			ApexTrackingApplication.startalarm("connection change");
//			// handle auto submit ,check update etc
////			dbgUtil.Log(Log.INFO,TAG, "ConnectivityManager.CONNECTIVITY_ACTION");
////			
////			new AutoUpdateCheckThread(context, false).start();
////
////			new AutoSubmitThread(context).start();
//
//		}	       
        
	}

}
