package com.uiui.zyappstore.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.uiui.zyappstore.service.GuardService;
import com.uiui.zyappstore.service.main.MainService;
import com.uiui.zyappstore.service.StepService;
import com.uiui.zyappstore.utils.JGYUtils;
import com.uiui.zyappstore.utils.LogUtils;

public class BootReceiver extends BroadcastReceiver {
    public static final String BOOT_COMPLETED = "zuoyeos.action.BOOT_COMPLETED";

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        Log.e("StoreBootReceiver", action);
        switch (action) {
            default:
                break;
            case Intent.ACTION_BOOT_COMPLETED:
            case BOOT_COMPLETED:
                context.startService(new Intent(context, MainService.class));
                context.startService(new Intent(context, StepService.class));
                context.startService(new Intent(context, GuardService.class));
                LogUtils.e("StoreBootReceiver", "booting BootReceiver");
                JGYUtils.getInstance().wakeUpDeviceInfo();
                break;
        }
    }
}
