From b19d02fd34eac64f15f64381e11736fa8f720079 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 12 Feb 2022 10:23:14 +0100 Subject: [PATCH] show an error at marshmallow flashlight toggling too --- .../simplemobiletools/flashlight/helpers/MarshmallowCamera.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MarshmallowCamera.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MarshmallowCamera.kt index 12d6057..6001a29 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MarshmallowCamera.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MarshmallowCamera.kt @@ -5,6 +5,7 @@ import android.content.Context import android.hardware.camera2.CameraManager import android.os.Build import android.os.Handler +import com.simplemobiletools.commons.extensions.showErrorToast import com.simplemobiletools.flashlight.models.Events import org.greenrobot.eventbus.EventBus @@ -25,6 +26,7 @@ internal class MarshmallowCamera constructor(val context: Context) { try { manager.setTorchMode(cameraId!!, enable) } catch (e: Exception) { + context.showErrorToast(e) val mainRunnable = Runnable { EventBus.getDefault().post(Events.CameraUnavailable()) }