package com.dmc.callcrm.service import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import com.dmc.callcrm.data.Prefs import com.dmc.callcrm.sync.SyncWorker /** Re-arms everything after the phone reboots. */ class BootReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { val action = intent.action ?: return val isBoot = action == Intent.ACTION_BOOT_COMPLETED || action == "android.intent.action.QUICKBOOT_POWERON" || action == "com.htc.intent.action.QUICKBOOT_POWERON" if (!isBoot) return if (Prefs(context).isRegistered) { SyncWorker.schedule(context) com.dmc.callcrm.sync.RecordingWorker.schedule(context) CallMonitorService.start(context) } } }