package com.zxhyis.toolss.notification.broadcast

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent

class TimerControlReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        val action = intent.action
        if (ACTION_START_TIMER == action && !isTimerRunning) {
            // 启动定时器
//            startTimer(intent,context)
        } else if (ACTION_STOP_TIMER == action && isTimerRunning) {
            // 停止定时器
            stopTimer(context)
        }
    }


    private fun stopTimer(context: Context) {
        isTimerRunning = false
    }

    companion object {
        private const val ACTION_START_TIMER = "com.zxhyis.toolss.timercontrol.START_TIMER"
        private const val ACTION_STOP_TIMER = "com.zxhyis.toolss.timercontrol.STOP_TIMER"
        private var isTimerRunning = false
    }
}