mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-01-31 18:44:52 +01:00
show an error at marshmallow flashlight toggling too
This commit is contained in:
parent
dc91665ba7
commit
b19d02fd34
@ -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())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user