Skip to content
Snippets Groups Projects
Commit beeafb0a authored by Anon's avatar Anon
Browse files

MainActivity: Disable background job.

parent c3f77ee1
No related branches found
No related tags found
No related merge requests found
......@@ -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)
// }
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment