fix #19, release camera on flashlight stoping

This commit is contained in:
tibbi 2017-11-06 12:26:18 +01:00
parent 0038b14347
commit 93c4cd7226
1 changed files with 5 additions and 0 deletions

View File

@ -112,6 +112,10 @@ class MyCameraImpl(val context: Context) {
}
private fun checkFlashlight() {
if (camera == null) {
handleCameraSetup()
}
if (isFlashlightOn) {
enableFlashlight()
} else {
@ -158,6 +162,7 @@ class MyCameraImpl(val context: Context) {
camera!!.parameters = params
}
stateChanged(false)
releaseCamera()
}
private fun stateChanged(isEnabled: Boolean) {