Skip to content

Commit 35336fd

Browse files
committed
fix: turn off flashlight when decreasing all the way down
1 parent fcf562b commit 35336fd

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [3.0 Beta 3](https://github.com/sds100/KeyMapper/releases/tag/v3.0.0-beta.3)
2+
3+
## Changed
4+
5+
- Turn off flashlight when using decrease brightness action.
6+
17
## [3.0 Beta 2](https://github.com/sds100/KeyMapper/releases/tag/v3.0.0-beta.2)
28

39
#### 27 March 2025

app/src/main/java/io/github/sds100/keymapper/system/camera/AndroidCameraAdapter.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ class AndroidCameraAdapter(context: Context) : CameraAdapter {
179179
.toInt()
180180
.coerceIn(1, maxStrength)
181181

182-
cameraManager.turnOnTorchWithStrengthLevel(cameraId, newStrength)
182+
if (newStrength == 1 && currentStrength == 1) {
183+
cameraManager.setTorchMode(cameraId, false)
184+
} else {
185+
cameraManager.turnOnTorchWithStrengthLevel(cameraId, newStrength)
186+
}
183187
}
184188

185189
return Success(Unit)

0 commit comments

Comments
 (0)