mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-01-19 04:01:42 +01: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() {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user