From c354d115eee151d848ce3b7144ce4f460874284c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 5 Oct 2023 09:43:50 +0200 Subject: [PATCH] Fix `MyCameraImpl` crash --- .../simplemobiletools/flashlight/helpers/MyCameraImpl.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 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 60760b2..b69e3a0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt @@ -47,6 +47,9 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT private val scope = CoroutineScope(Dispatchers.Default) + private val _flashlightOn = MutableStateFlow(false) + val flashlightOnFlow = _flashlightOn.asStateFlow() + private val cameraFlash: CameraFlash? get() { if (MyCameraImpl.cameraFlash == null) { @@ -60,9 +63,6 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT stroboFrequency = context.config.stroboscopeFrequency } - private val _flashlightOn = MutableStateFlow(false) - val flashlightOnFlow = _flashlightOn.asStateFlow() - private val _sosDisabled = MutableSharedFlow() val sosDisabled = _sosDisabled.asSharedFlow()