package com.ejada.hmg.geofence.intent_receivers

import android.app.job.JobParameters
import android.app.job.JobService
import com.ejada.hmg.geofence.HMG_Geofence
import com.ejada.hmg.utils.Logs

class ReregisterGeofenceJobService : JobService(){
    companion object{
        val TriggerIntervalDuration:String = "06:00:00"
        val JobID = 918273
    }
    override fun onStartJob(params: JobParameters?): Boolean {
        Logs.save(applicationContext,"ReregisterGeofenceJobService.onStartJob", "triggered to re-register the geofences after $TriggerIntervalDuration >> [HH:mm:ss]")
        HMG_Geofence.shared(applicationContext).register(){ status, error ->
            jobFinished(params, true)
        }
        return true
    }

    override fun onStopJob(params: JobParameters?): Boolean {
        return true
    }
}