package app.furmeet.events.system.helper

import android.app.job.JobInfo
import android.os.Build

fun JobInfo.Builder.setRequiresBatteryNotLowCompat(boolean: Boolean): JobInfo.Builder =
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
            setRequiresBatteryNotLow(boolean)
        else
            this


fun JobInfo.Builder.setPeriodicCompat(intervalMillis: Long, flexMillis: Long): JobInfo.Builder =
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
            setPeriodic(intervalMillis, flexMillis)
        else
            setPeriodic(intervalMillis)
