package com.mn.keeplive.activity;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;

public class keepReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if(TextUtils.equals(action,Intent.ACTION_SCREEN_OFF)){
            //锁屏状态，就要去开启1像素的activity
            KeepManager.getInstance().startKeep(context);
        }else  if(TextUtils.equals(action,Intent.ACTION_SCREEN_ON)){
            //开屏状态，就要去关闭1像素的activity
            KeepManager.getInstance().finishKeep();
        }

    }
}
