mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-03-06 12:37:44 +01:00
Make timer staring synchronized
This commit is contained in:
parent
c825bf16a2
commit
a810c0d3ef
@ -26,7 +26,7 @@ object SleepTimer {
|
||||
}
|
||||
|
||||
context(Context)
|
||||
fun startTimer() {
|
||||
fun startTimer() = synchronized(this@SleepTimer) {
|
||||
val millisInFuture = config.sleepInTS - System.currentTimeMillis() + 1000L
|
||||
sleepTimer?.cancel()
|
||||
sleepTimer = object : CountDownTimer(millisInFuture, 1000) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user