Skip to content

Commit 4967897

Browse files
committed
replaces hardcoded min value
1 parent 05d7625 commit 4967897

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

app/src/main/java/org/koreader/launcher/device/lights/Rockchip3566Controller.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,16 @@ class Rockchip3566Controller : LightsInterface {
153153
}
154154

155155
private fun setBrightnessInternal(context: Context, brightness: Int) {
156-
val defaultTemp = 0
157156
val temperature =
158-
getSystemProperty(SYS_PROP_TEMPERATURE, 0.toString())
159-
?.toIntOrNull() ?: defaultTemp
157+
getSystemProperty(SYS_PROP_TEMPERATURE, MIN.toString())
158+
?.toIntOrNull() ?: MIN
160159
setLight(context, brightness, temperature)
161160
}
162161

163162
private fun setTemperatureInternal(context: Context, temperature: Int) {
164-
val defaultTemp = 0
165163
val brightness =
166-
getSystemProperty(SYS_PROP_BRIGHTNESS, 0.toString())
167-
?.toIntOrNull() ?: defaultTemp
164+
getSystemProperty(SYS_PROP_BRIGHTNESS, MIN.toString())
165+
?.toIntOrNull() ?: MIN
168166
setLight(context, brightness, temperature)
169167
}
170168

0 commit comments

Comments
 (0)