We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0038b14 commit 93c4cd7Copy full SHA for 93c4cd7
app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt
@@ -112,6 +112,10 @@ class MyCameraImpl(val context: Context) {
112
}
113
114
private fun checkFlashlight() {
115
+ if (camera == null) {
116
+ handleCameraSetup()
117
+ }
118
+
119
if (isFlashlightOn) {
120
enableFlashlight()
121
} else {
@@ -158,6 +162,7 @@ class MyCameraImpl(val context: Context) {
158
162
camera!!.parameters = params
159
163
160
164
stateChanged(false)
165
+ releaseCamera()
161
166
167
168
private fun stateChanged(isEnabled: Boolean) {
0 commit comments