Skip to content

Commit b19d02f

Browse files
committed
show an error at marshmallow flashlight toggling too
1 parent dc91665 commit b19d02f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MarshmallowCamera.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import android.content.Context
55
import android.hardware.camera2.CameraManager
66
import android.os.Build
77
import android.os.Handler
8+
import com.simplemobiletools.commons.extensions.showErrorToast
89
import com.simplemobiletools.flashlight.models.Events
910
import org.greenrobot.eventbus.EventBus
1011

@@ -25,6 +26,7 @@ internal class MarshmallowCamera constructor(val context: Context) {
2526
try {
2627
manager.setTorchMode(cameraId!!, enable)
2728
} catch (e: Exception) {
29+
context.showErrorToast(e)
2830
val mainRunnable = Runnable {
2931
EventBus.getDefault().post(Events.CameraUnavailable())
3032
}

0 commit comments

Comments
 (0)