mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-04-22 14:17:32 +02:00
Fix error state for stroboscope and SOS
This commit is contained in:
parent
b0ea8d8ef2
commit
18c8bf3c7a
@ -272,12 +272,12 @@ class MyCameraImpl private constructor(private val context: Context, private var
|
|||||||
handleCameraSetup()
|
handleCameraSetup()
|
||||||
while (!shouldStroboscopeStop) {
|
while (!shouldStroboscopeStop) {
|
||||||
try {
|
try {
|
||||||
cameraFlash.runOrToast {
|
cameraFlash!!.run {
|
||||||
toggleFlashlight(true)
|
toggleFlashlight(true)
|
||||||
}
|
}
|
||||||
val onDuration = if (isStroboSOS) SOS[sosIndex++ % SOS.size] else stroboFrequency
|
val onDuration = if (isStroboSOS) SOS[sosIndex++ % SOS.size] else stroboFrequency
|
||||||
Thread.sleep(onDuration)
|
Thread.sleep(onDuration)
|
||||||
cameraFlash.runOrToast {
|
cameraFlash!!.run {
|
||||||
toggleFlashlight(false)
|
toggleFlashlight(false)
|
||||||
}
|
}
|
||||||
val offDuration = if (isStroboSOS) SOS[sosIndex++ % SOS.size] else stroboFrequency
|
val offDuration = if (isStroboSOS) SOS[sosIndex++ % SOS.size] else stroboFrequency
|
||||||
|
Loading…
x
Reference in New Issue
Block a user