Commit beeafb0a authored by Anon's avatar Anon
Browse files

MainActivity: Disable background job.

parent c3f77ee1
...@@ -104,16 +104,16 @@ class MainActivity : AppCompatActivity() { ...@@ -104,16 +104,16 @@ class MainActivity : AppCompatActivity() {
.replace(R.id.fragment_container, fragment) .replace(R.id.fragment_container, fragment)
.commit() .commit()
val workManager = WorkManager.getInstance(this) // val workManager = WorkManager.getInstance(this)
if (!bluetoothAdapter.bondedDevices.isEmpty() // if (!bluetoothAdapter.bondedDevices.isEmpty()
) { // ) {
val updateClockRequest = // val updateClockRequest =
PeriodicWorkRequestBuilder<UpdateClockJob>(UPDATE_CLOCK_FREQUENCY_MINS.toLong(), TimeUnit.MINUTES) // PeriodicWorkRequestBuilder<UpdateClockJob>(UPDATE_CLOCK_FREQUENCY_MINS.toLong(), TimeUnit.MINUTES)
.build() // .build()
workManager // workManager
.enqueueUniquePeriodicWork(WORK_NAME, ExistingPeriodicWorkPolicy.REPLACE, updateClockRequest) // .enqueueUniquePeriodicWork(WORK_NAME, ExistingPeriodicWorkPolicy.REPLACE, updateClockRequest)
} else { // } else {
workManager.cancelUniqueWork(WORK_NAME) // workManager.cancelUniqueWork(WORK_NAME)
} // }
} }
} }
Markdown is supported
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