mirror of
				https://github.com/SimpleMobileTools/Simple-Flashlight.git
				synced 2025-06-05 21:59:19 +02:00 
			
		
		
		
	show an error at marshmallow flashlight toggling too
This commit is contained in:
		| @@ -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()) | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user