From 18c8bf3c7a87eb8ef9f1824c9b0caa50d1e04dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Tue, 17 Oct 2023 13:03:08 +0200 Subject: [PATCH] Fix error state for stroboscope and SOS --- .../com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt index 0fb1b0c..ea5c18f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt @@ -272,12 +272,12 @@ class MyCameraImpl private constructor(private val context: Context, private var handleCameraSetup() while (!shouldStroboscopeStop) { try { - cameraFlash.runOrToast { + cameraFlash!!.run { toggleFlashlight(true) } val onDuration = if (isStroboSOS) SOS[sosIndex++ % SOS.size] else stroboFrequency Thread.sleep(onDuration) - cameraFlash.runOrToast { + cameraFlash!!.run { toggleFlashlight(false) } val offDuration = if (isStroboSOS) SOS[sosIndex++ % SOS.size] else stroboFrequency