Skip to content

Instantly share code, notes, and snippets.

@brendan-fahy
Created January 19, 2017 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendan-fahy/8f6ef7f6366c43f050bef858b5dedfba to your computer and use it in GitHub Desktop.
Save brendan-fahy/8f6ef7f6366c43f050bef858b5dedfba to your computer and use it in GitHub Desktop.
private fun jobInfo(context: Context): JobInfo {
val serviceName = ComponentName(context, PowerService::class.java)
return JobInfo.Builder(JOB_ID, serviceName)
.setRequiredNetworkType(JobInfo.NETWORK_TYPE_NONE)
.setRequiresCharging(true)
.setPeriodic(JOB_INTERVAL)
.build()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment