Commit dc0e5f5c authored by Andreas Schildbach's avatar Andreas Schildbach
Browse files

MainActivity: Extract UPDATE_CLOCK_FREQUENCY_MINS to Constants and increase it to 5 minutes.

parent 388edae7
......@@ -35,3 +35,5 @@ val ROCKETS_CHARACTERISTIC_UUID = UUID.fromString("42230210-2342-2342-2342-23422
val SINGLE_LED_CHARACTERISTIC_UUID = UUID.fromString("42230211-2342-2342-2342-234223422342")
val LIGHT_SENSOR_CHARACTERISTIC_UUID = UUID.fromString("422302f0-2342-2342-2342-234223422342")
val TIME_CHARACTERISTIC_UUID = UUID.fromString("42230201-2342-2342-2342-234223422342")
const val UPDATE_CLOCK_FREQUENCY_MINS = 5
......@@ -108,7 +108,7 @@ class MainActivity : AppCompatActivity() {
if (!bluetoothAdapter.bondedDevices.isEmpty()
) {
val updateClockRequest =
PeriodicWorkRequestBuilder<UpdateClockJob>(1, TimeUnit.MINUTES)
PeriodicWorkRequestBuilder<UpdateClockJob>(UPDATE_CLOCK_FREQUENCY_MINS.toLong(), TimeUnit.MINUTES)
.build()
workManager
.enqueueUniquePeriodicWork(WORK_NAME, ExistingPeriodicWorkPolicy.REPLACE, updateClockRequest)
......
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