mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-04-22 22:27:32 +02:00
fix #19, release camera on flashlight stoping
This commit is contained in:
parent
0038b14347
commit
93c4cd7226
@ -112,6 +112,10 @@ class MyCameraImpl(val context: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun checkFlashlight() {
|
private fun checkFlashlight() {
|
||||||
|
if (camera == null) {
|
||||||
|
handleCameraSetup()
|
||||||
|
}
|
||||||
|
|
||||||
if (isFlashlightOn) {
|
if (isFlashlightOn) {
|
||||||
enableFlashlight()
|
enableFlashlight()
|
||||||
} else {
|
} else {
|
||||||
@ -158,6 +162,7 @@ class MyCameraImpl(val context: Context) {
|
|||||||
camera!!.parameters = params
|
camera!!.parameters = params
|
||||||
}
|
}
|
||||||
stateChanged(false)
|
stateChanged(false)
|
||||||
|
releaseCamera()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun stateChanged(isEnabled: Boolean) {
|
private fun stateChanged(isEnabled: Boolean) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user