clear listeners after disabling flash for SOS and stroboscope

- this prevents the two sliders for brightness and stroboscope from showing up at the same time
This commit is contained in:
darthpaul 2022-11-15 14:28:35 +00:00
parent 98c0f0578e
commit c975ab1e82

View File

@ -49,7 +49,6 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
fun toggleStroboscope(): Boolean {
handleCameraSetup()
cameraFlash!!.unregisterListeners()
if (isSOSRunning) {
stopSOS()
@ -62,6 +61,8 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
disableFlashlight()
}
cameraFlash!!.unregisterListeners()
if (!tryInitCamera()) {
return false
}
@ -82,7 +83,6 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
fun toggleSOS(): Boolean {
handleCameraSetup()
cameraFlash!!.unregisterListeners()
if (isStroboscopeRunning) {
stopStroboscope()
@ -103,6 +103,8 @@ class MyCameraImpl private constructor(val context: Context, private var cameraT
disableFlashlight()
}
cameraFlash!!.unregisterListeners()
return if (isSOSRunning) {
stopSOS()
false