Commit beeafb0a authored by Anon's avatar Anon
Browse files

MainActivity: Disable background job.

parent c3f77ee1
......@@ -104,16 +104,16 @@ class MainActivity : AppCompatActivity() {
.replace(R.id.fragment_container, fragment)
.commit()
val workManager = WorkManager.getInstance(this)
if (!bluetoothAdapter.bondedDevices.isEmpty()
) {
val updateClockRequest =
PeriodicWorkRequestBuilder<UpdateClockJob>(UPDATE_CLOCK_FREQUENCY_MINS.toLong(), TimeUnit.MINUTES)
.build()
workManager
.enqueueUniquePeriodicWork(WORK_NAME, ExistingPeriodicWorkPolicy.REPLACE, updateClockRequest)
} else {
workManager.cancelUniqueWork(WORK_NAME)
}
// val workManager = WorkManager.getInstance(this)
// if (!bluetoothAdapter.bondedDevices.isEmpty()
// ) {
// val updateClockRequest =
// PeriodicWorkRequestBuilder<UpdateClockJob>(UPDATE_CLOCK_FREQUENCY_MINS.toLong(), TimeUnit.MINUTES)
// .build()
// workManager
// .enqueueUniquePeriodicWork(WORK_NAME, ExistingPeriodicWorkPolicy.REPLACE, updateClockRequest)
// } else {
// workManager.cancelUniqueWork(WORK_NAME)
// }
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment